Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateId() uuid.UUID
- func GenerateId32() string
- func GenerateId36() string
- func GetClaims(context *gin.Context) (data *system.CustomClaims)
- func GetDBByName(database string) *gorm.DB
- func GetOpenId(context *gin.Context) (openId string)
- func GetRandomString(l int) string
- func GetTokenInfo(context *gin.Context) (info *system.CustomClaims)
- func GetUserDB() *gorm.DB
- func GetUserID(context *gin.Context) (userId uint64)
- func Json(v interface{}) string
- func Logger(outPath string) *logrus.Logger
- func MD5(text string) string
- func ModelObjectToSlice(inArr interface{}, key string) (ret []uint64)
- func SHA256(text string) string
- func StatusText(code int) string
- type BaseUserInfo
- type JsonObject
- type LoginParams
- type PageBean
Constants ¶
View Source
const ( GetDataOK = 20199 BindModelErr = 20200 NoneParamErr = 20201 LoginStatusSQLErr = 20319 LoginStatusErr = 20300 LoginStatusOK = 20301 SaveStatusOK = 20400 SaveStatusErr = 20401 SaveObjIsNil = 20402 DeleteStatusOK = 20403 DeleteStatusErr = 20404 DeleteObjIsNil = 20405 UpdateObjIsNil = 20406 ExistSameNameErr = 20501 ExistSamePhoneErr = 20502 FixLessZeroErr = 20797 MaxLessZeroErr = 20798 MinThanMaxErr = 20799 MediumPasswordErr = 20801 StrongPasswordErr = 20802 ChineseNameErr = 20803 EnglishNameErr = 20804 GenerateAppTokErr = 20805 WechatCodeErr = 40029 //保持错误码和微信一致 )
View Source
const Salt string = "*$salt@*"
Variables ¶
View Source
var ( SQLLogger *logrus.Logger AccessLogger *logrus.Logger ServiceLogger *logrus.Logger WorkLogger *logrus.Logger ErrorLogger *logrus.Logger )
View Source
var DBConnect = make(map[string]*gorm.DB)
var DBConnect map[string]*gorm.DB
Functions ¶
func GenerateId ¶
func GenerateId32 ¶
func GenerateId32() string
func GenerateId36 ¶
func GenerateId36() string
func GetDBByName ¶
func GetRandomString ¶
func GetTokenInfo ¶
func GetTokenInfo(context *gin.Context) (info *system.CustomClaims)
func ModelObjectToSlice ¶
func StatusText ¶
Types ¶
type BaseUserInfo ¶
type BaseUserInfo struct { OpenId string `json:"openId"` Nickname string `json:"nickName"` Gender string `json:"gender"` Language string `json:"language"` City string `json:"-"` Province string `json:"province"` Country string `json:"country"` AvatarUrl string `json:"avatarUrl"` Token string `json:"token"` UserID uint64 `json:"userId"` }
type JsonObject ¶
type JsonObject struct { /** 状态码 */ Code int `json:"code"` /** 内容体 */ Content interface{} `json:"data"` /** 消息 */ Message string `json:"message"` }
统一 json 结构体
type LoginParams ¶
type LoginParams struct { /** 用户名或者账号 */ Username string `json:"username" form:"username"` /** 密码 */ Password string `json:"password" form:"password"` /** 验证码 */ Code string `json:"code" form:"code"` }
统一登陆模型
Source Files ¶
Click to show internal directories.
Click to hide internal directories.