Documentation ¶
Index ¶
- func CustomTimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
- func Fail(msg string, c *gin.Context)
- func FailWithData(code int, data interface{}, c *gin.Context)
- func FailWithMessage(code int, message string, c *gin.Context)
- func GetValidator() *global.Validate
- func GormMysql(m config.Mysql) *gorm.DB
- func GormPostgres(m config.Postgres) *gorm.DB
- func InitCasbin() *casbin.SyncedEnforcer
- func InitServer(address string, router *gin.Engine) server
- func Redis() *redis.Client
- func Result(code int, data interface{}, msg string, c *gin.Context)
- func Success(data interface{}, c *gin.Context)
- func SuccessWithData(data interface{}, c *gin.Context)
- func SuccessWithMessage(message string, c *gin.Context)
- func UnauthorizedWithMessage(message string, c *gin.Context)
- func Viper() *viper.Viper
- func Zap() (logger *zap.Logger)
- type CommonRes
- type DingTalk
- type Response
- type TokenRes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CustomTimeEncoder ¶
func CustomTimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
CustomTimeEncoder
@Description: 获取Encoder的zapcore.Core @param t @param enc
func FailWithMessage ¶
FailWithMessage
@Description: 失败且返回信息 @receiver h @param code @param message @param c
func InitCasbin ¶
func InitCasbin() *casbin.SyncedEnforcer
InitCasbin
@Description: Casbin实例初始化 @return *casbin.SyncedEnforcer
func InitServer ¶
func SuccessWithMessage ¶
SuccessWithMessage
@Description: 成功且回复信息 @receiver h @param message @param c
func UnauthorizedWithMessage ¶
UnauthorizedWithMessage
@Description: 授权错误返回信息 @param message @param c
Types ¶
type CommonRes ¶
type CommonRes struct { Errcode int `json:"errcode"` // 错误码,0为正常 Errmsg string `json:"errmsg"` // 错误信息 RequestId string `json:"request_id"` // 请求ID }
CommonRes
@Description: 钉钉API通用返回结构
type DingTalk ¶
type DingTalk struct { }
func (*DingTalk) CallPostApi ¶
CallPostApi
@Description: 调取[Post]API接口 @receiver t @param apiUrl api地址 @param bodyStruct 请求主体结构 @return resByte @return err
Source Files ¶
Click to show internal directories.
Click to hide internal directories.