Documentation ¶
Index ¶
- Variables
- func DecodeErr(err error, data interface{}) (int, string, interface{})
- func DoInstanceWork(client *sdk.LicenseClient)
- func DoProductWork(client *sdk.LicenseClient)
- func GetLicenseClient() (client *sdk.LicenseClient, err error)
- func GinLogger() gin.HandlerFunc
- func GinRecovery(stack bool) gin.HandlerFunc
- func NewLogger(config zapcore.EncoderConfig, logLevel string) *zap.Logger
- func NewSugaredLogger(config zapcore.EncoderConfig, logLevel string) *zap.SugaredLogger
- type BgPageRes
- type BgRes
- type HTTP
- type Http
- type License
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // 成功 OK = BgRes{Code: 200, Msg: "执行成功"} DeleteOK = BgRes{Code: 200, Msg: "删除成功"} Fail = BgRes{Code: 500, Msg: "执行失败"} Has = BgRes{Code: 500, Msg: "已存在"} // 参数错误 ParamsParserError = BgRes{Code: 4000001, Msg: "参数类型不匹配,解析失败"} ParamsEmptyError = BgRes{Code: 4000002, Msg: "参数不能为空"} // 权限错误 LoginTimeOutError = BgRes{Code: 4010001, Msg: "登录超时"} // 服务器错误 InternalServerError = BgRes{Code: 5000001, Msg: "系统异常"} DataFailError = BgRes{Code: 5000002, Msg: "数据获取失败"} LogoutError = BgRes{Code: 5000003, Msg: "退出失败"} AccountNotEnableError = BgRes{Code: 5000004, Msg: "该账户未启用,不能登录"} // 数据库错误 DbConnectError = BgRes{Code: 5010001, Msg: "数据库连接失败"} )
View Source
var LicenseClient *sdk.LicenseClient
View Source
var Logger *zap.Logger
View Source
var ProductLicense = &License{}
Functions ¶
func DoInstanceWork ¶ added in v1.2.3
func DoInstanceWork(client *sdk.LicenseClient)
func DoProductWork ¶
func DoProductWork(client *sdk.LicenseClient)
func GinRecovery ¶
func GinRecovery(stack bool) gin.HandlerFunc
GinRecovery recover掉项目可能出现的panic,并使用zap记录相关日志
func NewSugaredLogger ¶
func NewSugaredLogger(config zapcore.EncoderConfig, logLevel string) *zap.SugaredLogger
Types ¶
type BgPageRes ¶
type BgPageRes struct { Code int `json:"code"` Msg string `json:"msg"` Data interface{} `json:"data"` Total int64 `json:"total"` }
func (BgPageRes) ErrorDetail ¶
type BgRes ¶
func (BgRes) ErrorDetail ¶
Click to show internal directories.
Click to hide internal directories.