util

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ParamError = 1000 // 参数参数错误
View Source
const UnKnowError = 9999 // 未知错误

Variables

View Source
var ErrorCodeMap = map[string]int{
	"verifyCodeError": 1001, "userNotFound": 1002, "passwordError": 1003, "phoneLimit": 1004, "unauthorized": 1005,
}
View Source
var ErrorMsgMap = map[int]string{
	1001: "验证码错误", 1002: "用户没找到", 1003: "用户名或密码错误", 1004: "被限制的手机号", 1005: "未经授权的",
}
View Source
var ErrorMsgMapEn = map[int]string{
	1001: "verify code error", 1002: "user not found", 1003: "user or password error", 1004: "phone limit", 1005: "unauthorized",
}

Functions

func CheckBirthDate

func CheckBirthDate(fl validator.FieldLevel) bool

检测生日

func ErrorWarper

func ErrorWarper(err error) gin.H

func GetUID

func GetUID() (id uint64, err error)

获取全局 ID 的函数

func IdCardValidator

func IdCardValidator(fl validator.FieldLevel) bool

IdCard 验证身份证号码

func Init

func Init(mID uint16)

初始化 sonyFlake 配置

func MobileValidator

func MobileValidator(fl validator.FieldLevel) bool

Mobile 验证手机号码

Types

This section is empty.

Jump to

Keyboard shortcuts

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