Documentation
¶
Index ¶
- func CheckPermission(ctx context.Context) (string, error)
- func GenUserNoPrefix() string
- func GenerateUniqueId(length int) string
- func GenerateUniqueIdPureLowercase(length int) string
- func GetTokenFromContext(ctx context.Context) (*utils.TokenInfo, error)
- func GetUserGender(gender string) int32
- func HidePhoneNumber(phone string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPermission ¶
CheckPermission 需要校验token并从中提取user_id的接口,都需要调用该函数
func GenerateUniqueId ¶ added in v1.16.0
GenerateUniqueId Generate custom length user No.
func GenerateUniqueIdPureLowercase ¶ added in v1.16.0
GenerateUniqueIdPureLowercase Generate custom length pure lowercase user No.
func GetTokenFromContext ¶ added in v1.13.0
func GetUserGender ¶
GetUserGender todo 临时的兼容,后面db里gender字段修改为整数类型后,此方法作废
func HidePhoneNumber ¶ added in v1.16.0
HidePhoneNumber Keep the last 4 digits of phone number
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.