Documentation ¶
Index ¶
- Constants
- func Fail(c *gin.Context)
- func FailWithDetailed(data interface{}, message string, c *gin.Context)
- func FailWithMessage(message string, c *gin.Context)
- func GinMustBind(c *gin.Context, obj interface{}) error
- func Ok(c *gin.Context)
- func OkWithData(data interface{}, c *gin.Context)
- func OkWithDetailed(data interface{}, message string, c *gin.Context)
- func OkWithMessage(message string, c *gin.Context)
- func RegBinding(mime string, b binding.Binding)
- func RegBindingHandler(h BindingHandler)
- func Result(code int, data interface{}, msg string, c *gin.Context)
- func ResultErr(data interface{}, e error, c *gin.Context)
- type BindingHandler
- type ErrorWithCode
- type ErrorWithHttpCode
- type IdExt
- type IdText
- type JDates
- type JIDs
- func (id *JIDs) FromID(ids []uint)
- func (id *JIDs) FromInt(ids []int)
- func (id *JIDs) FromInt64(ids []int64)
- func (id *JIDs) FromTag(elems []string)
- func (id JIDs) GetID() []uint
- func (id JIDs) GetIDUnique() []uint
- func (id JIDs) GetInt() []int
- func (id JIDs) GetTag() []string
- func (id JIDs) GetTagUnique() []string
- type KeyText
- type PageReq
- type PageResp
- type ReqWithCtx
- type ReqWithIP
- type ReqWithNow
- type Response
Constants ¶
View Source
const ( ERROR = 7 SUCCESS = 0 )
Variables ¶
This section is empty.
Functions ¶
func FailWithDetailed ¶
func FailWithMessage ¶
func OkWithData ¶
func OkWithDetailed ¶
func OkWithMessage ¶
func RegBindingHandler ¶
func RegBindingHandler(h BindingHandler)
Types ¶
type ErrorWithCode ¶
type ErrorWithCode interface {
ErrorCode() int
}
type ErrorWithHttpCode ¶
type ErrorWithHttpCode interface {
ErrorHttpCode() int
}
type PageReq ¶
type PageReq struct { Page int `form:"page" json:"page" query:"page" example:"1"` // 页号,从1开始 PageSize int `form:"pageSize" json:"pageSize" query:"pageSize" example:"10"` // 分页大小 }
PageReq 分页
func (*PageReq) FixPageSize ¶
type PageResp ¶
type ReqWithCtx ¶
type ReqWithCtx struct {
// contains filtered or unexported fields
}
ReqWithCtx 上下文环境
func (*ReqWithCtx) GetCtx ¶
func (R *ReqWithCtx) GetCtx() context.Context
func (*ReqWithCtx) GetCtxValue ¶
func (R *ReqWithCtx) GetCtxValue(k interface{}) interface{}
func (*ReqWithCtx) SetCtx ¶
func (R *ReqWithCtx) SetCtx(ctx context.Context)
func (*ReqWithCtx) SetCtxValue ¶
func (R *ReqWithCtx) SetCtxValue(k, v interface{})
type ReqWithIP ¶
type ReqWithIP struct {
// contains filtered or unexported fields
}
ReqWithIP 客户端 ip
type ReqWithNow ¶
type ReqWithNow struct {
// contains filtered or unexported fields
}
ReqWithNow 统一业务时间点
func (*ReqWithNow) GetNow ¶
func (R *ReqWithNow) GetNow() time.Time
func (*ReqWithNow) SetNow ¶
func (R *ReqWithNow) SetNow(now time.Time)
Click to show internal directories.
Click to hide internal directories.