Documentation ¶
Index ¶
- Constants
- func AddClearUserID(values string, valueToAdd string) string
- func CalculateProfit(userTotalAmount, upRate, feeRate, violationDeduction float64) bool
- func ContainsClearUserID(values string, valueToCheck string) bool
- func ConvertUserId(msg string) (uint64, error)
- func GenericCopy[T any](src interface{}) *T
- func GetHardWarePrice(priceBox float64, priceCompany float64) float64
- func GetImageCaptchaCacheKey(uuid string) string
- func RemoveClearUserID(values string, valueToRemove string) string
- func RoundUpToTwoDecimal(serviceFee float64) float64
- func ToJsonString(message interface{}) (string, error)
Constants ¶
View Source
const ImageCaptchaCacheKey = "IMAGE_CAPTCHA_CACHE:"
ImageCaptchaCacheKey 定义图形验证码缓存键前缀
Variables ¶
This section is empty.
Functions ¶
func AddClearUserID ¶ added in v0.0.21
AddClearUserID 添加一个值到字符串中(如果不存在),并返回添加后的字符串
func CalculateProfit ¶ added in v0.0.21
CalculateProfit 检查是否会赔钱 userTotalAmount: 用户的总金额 upRate: 上浮费率(例如 0.1 表示 10%) feeRate: 手续费费率(例如 0.02 表示 2%) violationDeduction: 违规扣除金额 返回值: 如果不赔钱返回 true,否则返回 false
func ContainsClearUserID ¶ added in v0.0.21
ContainsClearUserID 判断字符串中是否包含指定的值
func ConvertUserId ¶ added in v0.0.21
ConvertUserId 将 msg.UserId 从 string 转换为 uint64
func GenericCopy ¶ added in v0.0.17
func GenericCopy[T any](src interface{}) *T
GenericCopy 用于将一个类型的实例复制到另一个类型的实例
func GetHardWarePrice ¶ added in v0.0.21
GetHardWarePrice 如果箱体回收单价存在返回箱体回收单价,否则返回公司回收单价
func GetImageCaptchaCacheKey ¶ added in v0.0.19
GetImageCaptchaCacheKey 生成完整的图形验证码缓存键
func RemoveClearUserID ¶ added in v0.0.21
RemoveClearUserID 删除字符串中的一个特定值,并返回删除后的字符串
func RoundUpToTwoDecimal ¶ added in v0.0.21
RoundUpToTwoDecimal 保留两位小数并向上舍入
func ToJsonString ¶
ToJsonString 通用转换Json字符串函数
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.