Documentation ¶
Index ¶
- Variables
- func ErrJSONResp(c *gin.Context, httpCode int, err error)
- func FilterParser(ctx context.Context, f string, filterPointer interface{}) error
- func GetUid(c *gin.Context) int64
- func NotStrictAuthorizationMiddleware(secretKey string) gin.HandlerFunc
- func ParseAdminQuery(c *gin.Context, params *model.AdminListReq) error
- func ParseBody(c *gin.Context, reqPointer interface{}) error
- func ParseQuery(c *gin.Context, reqPointer interface{}) error
- func RangeParser(ctx context.Context, r string) (int, int, error)
- func RequestIdMiddleware(opts ...Option) gin.HandlerFunc
- func SetContentRangeHeader(c *gin.Context, offset, respLen, total int)
- func SortParser(ctx context.Context, sort string) (string, error)
- func StrictAuthorizationMiddleware(secretKey string) gin.HandlerFunc
- func SuccJSONResp(c *gin.Context, data interface{})
- type ErrorCode
- type Handler
- type JsonResponse
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // common ErrorInvalidArgument = ErrorCode{Code: 100000, Msg: "输入参数错误"} ErrorFrequentOperation = ErrorCode{Code: 100001, Msg: "频繁操作,稍后重试"} ErrorTryLater = ErrorCode{Code: 100002, Msg: "请稍后重试"} // login ErrorLoginForbid = ErrorCode{Code: 101000, Msg: "账号禁止登陆,请联系我们"} // gold ErrorGoldInsufficient = ErrorCode{Code: 102000, Msg: "能量不足,去攒能量吧!"} ErrorCreditInsufficient = ErrorCode{Code: 102002, Msg: "积分不足,去充值吧!"} )
View Source
var UIdCtxKey = "uid"
Functions ¶
func FilterParser ¶
func NotStrictAuthorizationMiddleware ¶
func NotStrictAuthorizationMiddleware(secretKey string) gin.HandlerFunc
func ParseAdminQuery ¶
func ParseAdminQuery(c *gin.Context, params *model.AdminListReq) error
func ParseQuery ¶
func RequestIdMiddleware ¶
func RequestIdMiddleware(opts ...Option) gin.HandlerFunc
func SetContentRangeHeader ¶
func StrictAuthorizationMiddleware ¶
func StrictAuthorizationMiddleware(secretKey string) gin.HandlerFunc
func SuccJSONResp ¶
Types ¶
type JsonResponse ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.