Documentation
¶
Index ¶
- Constants
- func AddClearUserID(values string, valueToAdd string) string
- func CalculateProfit(userTotalAmount, upRate, feeRate, violationDeduction decimal.Decimal) bool
- func ContainsClearUserID(values string, valueToCheck string) bool
- func ConvertUserId(msg string) (uint64, error)
- func GenerateOrderNumber() string
- func GenericCopy[T any](src interface{}) *T
- func GetHardWarePrice(priceBox, priceCompany decimal.Decimal) decimal.Decimal
- func GetImageCaptchaCacheKey(uuid string) string
- func JoinUint64Slice(ids []uint64, sep string) string
- func RemoveClearUserID(values string, valueToRemove string) string
- func RoundUpToTwoDecimal(value decimal.Decimal) decimal.Decimal
- func SendSubscribeMessage(mini *miniprogram.MiniProgram, openID, templateID, page, state string, ...) error
- func StringToUint64IdList(str string, sep string) ([]uint64, error)
- func ToJsonString(message interface{}) (string, error)
- type HolderProfit
- type HolderWithdraw
- type PagedListResponse
- type RubbishData
Constants ¶
View Source
const ImageCaptchaCacheKey = "IMAGE_CAPTCHA_CACHE:"
ImageCaptchaCacheKey 定义图形验证码缓存键前缀
Variables ¶
This section is empty.
Functions ¶
func AddClearUserID ¶
AddClearUserID 添加一个值到字符串中(如果不存在),并返回添加后的字符串
func CalculateProfit ¶
CalculateProfit 检查是否会赔钱 userTotalAmount: 用户的总金额 upRate: 上浮费率(例如 0.1 表示 10%) feeRate: 手续费费率(例如 0.02 表示 2%) violationDeduction: 违规扣除金额 返回值: 如果不赔钱返回 true,否则返回 false
func ContainsClearUserID ¶
ContainsClearUserID 判断字符串中是否包含指定的值
func ConvertUserId ¶
ConvertUserId 将 msg.UserId 从 string 转换为 uint64
func GetHardWarePrice ¶
GetHardWarePrice 如果箱体回收单价存在返回箱体回收单价,否则返回公司回收单价
func GetImageCaptchaCacheKey ¶
GetImageCaptchaCacheKey 生成完整的图形验证码缓存键
func JoinUint64Slice ¶
JoinUint64Slice 将 []uint64 转换为字符串并拼接
func RemoveClearUserID ¶
RemoveClearUserID 删除字符串中的一个特定值,并返回删除后的字符串
func RoundUpToTwoDecimal ¶
RoundUpToTwoDecimal 保留两位小数并向上舍入
func SendSubscribeMessage ¶
func SendSubscribeMessage(mini *miniprogram.MiniProgram, openID, templateID, page, state string, data map[string]*subscribe.DataItem) error
SendSubscribeMessage 封装方法
func StringToUint64IdList ¶
StringToUint64IdList 将字符串转换为 uint64 切片
Types ¶
type HolderProfit ¶
type HolderProfit struct { TotalProfit decimal.Decimal Weight decimal.Decimal OpenID string AppID string SN string }
HolderProfit 定义持有人分润的结构体
type HolderWithdraw ¶
HolderWithdraw 定义提现的结构体
type PagedListResponse ¶
type PagedListResponse struct { Total uint64 `json:"total"` // 总条数 Data interface{} `json:"data"` // 数据列表 }
type RubbishData ¶
type RubbishData struct { RequestId string `json:"request_id"` Day string `json:"day"` // 当前日期 Fn string `json:"fn"` // 功能码 Num string `json:"num"` // 箱体号 Sn string `json:"sn"` // 设备编号 UserId int64 `json:"user_id"` // 投递用户 Status string `json:"status"` // 箱体状态 Version string `json:"version"` // 主板版本 Weight decimal.Decimal `json:"weight"` // 箱体当前重量(或用户投递重量) TotalWeight decimal.Decimal `json:"total_weight"` // 箱体总重量 StartTime int64 `json:"start_time"` // 投递开始时间 EndTime int64 `json:"end_time"` // 投递结束时间 }
RubbishData 结构体映射 JSON 数据
Source Files
¶
- other.go
Click to show internal directories.
Click to hide internal directories.