Documentation
¶
Index ¶
- func CalculatePoints(amount int64, ratio float64) int64
- func CheckPassword(password, hash string) bool
- func Deref[T any](v *T) T
- func GenerateCouponCode() string
- func GenerateOrderNo(prefix string) string
- func GenerateToken(userID int64, userType string, storeID int64, roleCode string) (string, error)
- func GenerateUUID() string
- func GetEndOfDay(t time.Time) time.Time
- func GetStartOfDay(t time.Time) time.Time
- func HashPassword(password string) (string, error)
- func InArray[T comparable](item T, array []T) bool
- func MD5(str string) string
- func Max[T int | int64 | float64](a, b T) T
- func Min[T int | int64 | float64](a, b T) T
- func Pointer[T any](v T) *T
- func RandomInt(max int) int
- func RandomString(length int) string
- func RefreshToken(tokenString string) (string, error)
- type Claims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculatePoints ¶
CalculatePoints 计算消费积分 amount: 消费金额(分) ratio: 积分比例(每元返多少积分)
func GenerateToken ¶
GenerateToken 生成JWT token
Types ¶
Click to show internal directories.
Click to hide internal directories.