user

package
v1.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2025 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPermission

func CheckPermission(ctx context.Context) (string, error)

CheckPermission 需要校验token并从中提取user_id的接口,都需要调用该函数

func GenUserNoPrefix

func GenUserNoPrefix() string

GenUserNoPrefix 生成用户编号的前5位

func GenerateUniqueId added in v1.16.0

func GenerateUniqueId(length int) string

GenerateUniqueId Generate custom length user No.

func GenerateUniqueIdPureLowercase added in v1.16.0

func GenerateUniqueIdPureLowercase(length int) string

GenerateUniqueIdPureLowercase Generate custom length pure lowercase user No.

func GetTokenFromContext added in v1.13.0

func GetTokenFromContext(ctx context.Context) (*utils.TokenInfo, error)

func GetUserGender

func GetUserGender(gender string) int32

GetUserGender todo 临时的兼容,后面db里gender字段修改为整数类型后,此方法作废

func HidePhoneNumber added in v1.16.0

func HidePhoneNumber(phone string) string

HidePhoneNumber Keep the last 4 digits of phone number

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL