Documentation
¶
Index ¶
- Variables
- type DefaultListReq
- type DefaultResp
- func (c *DefaultResp) IsNull() bool
- func (c *DefaultResp) SetAccepted()
- func (c *DefaultResp) SetBadRequest(message string)
- func (c *DefaultResp) SetCodeAndMsg(code int, message string)
- func (c *DefaultResp) SetNotFound(message string)
- func (c *DefaultResp) SetServerError(message string)
- func (c *DefaultResp) SetSuccess()
- type PaginationMeta
- type PaginationReq
- type PaginationResult
- type RequestMeta
- type Response
- type ResponseImmediately
- func (r ResponseImmediately) IsNull() bool
- func (r ResponseImmediately) SetAccepted()
- func (r ResponseImmediately) SetBadRequest(message string)
- func (r ResponseImmediately) SetCodeAndMsg(code int, message string)
- func (r ResponseImmediately) SetNotFound(message string)
- func (r ResponseImmediately) SetServerError(message string)
- func (r ResponseImmediately) SetSuccess()
- type SQLSearchReq
- type SQLSortReq
- type SearchReqInterface
- type SortReqInterface
- type WSearchReq
- type WordReqInterface
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CtxUserNameKey = "userName" CtxUserIDKey = "userID" )
Functions ¶
This section is empty.
Types ¶
type DefaultListReq ¶
type DefaultListReq struct {
PaginationReq
RequestMeta
SQLSearchReq
SQLSortReq
}
func (*DefaultListReq) Modify ¶
func (c *DefaultListReq) Modify(ctx *gin.Context)
type DefaultResp ¶
type DefaultResp struct {
Code int `json:"code"`
Message string `json:"message"`
Result interface{} `json:"result"`
}
func (*DefaultResp) IsNull ¶
func (c *DefaultResp) IsNull() bool
func (*DefaultResp) SetAccepted ¶
func (c *DefaultResp) SetAccepted()
func (*DefaultResp) SetBadRequest ¶
func (c *DefaultResp) SetBadRequest(message string)
func (*DefaultResp) SetCodeAndMsg ¶
func (c *DefaultResp) SetCodeAndMsg(code int, message string)
func (*DefaultResp) SetNotFound ¶
func (c *DefaultResp) SetNotFound(message string)
func (*DefaultResp) SetServerError ¶
func (c *DefaultResp) SetServerError(message string)
func (*DefaultResp) SetSuccess ¶
func (c *DefaultResp) SetSuccess()
type PaginationMeta ¶
type PaginationReq ¶
type PaginationReq struct {
Page uint32 `json:"page" form:"page"`
PageSize uint32 `json:"page_size" form:"page_size"`
}
func (*PaginationReq) Limit ¶
func (c *PaginationReq) Limit() int64
func (*PaginationReq) Modify ¶
func (c *PaginationReq) Modify(ctx *gin.Context)
func (*PaginationReq) Offset ¶
func (c *PaginationReq) Offset() int64
type PaginationResult ¶
type PaginationResult struct {
Items interface{} `json:"items"`
Pagination PaginationMeta `json:"pagination,omitempty"`
}
type RequestMeta ¶
type RequestMeta struct {
RequestUserID string `json:"-" form:"-" uri:"-"` // 请求用户ID
RequestUserName string `json:"-" form:"-" uri:"-"` // 请求用户名
Ctx context.Context `json:"-" form:"-" uri:"-"` // 上下文
GinCtx *gin.Context `json:"-" form:"-" uri:"-"` // gin上下文
}
func (*RequestMeta) GetCtx ¶
func (b *RequestMeta) GetCtx() context.Context
func (*RequestMeta) Modify ¶
func (b *RequestMeta) Modify(c *gin.Context)
type ResponseImmediately ¶
type ResponseImmediately struct {
}
func (ResponseImmediately) IsNull ¶
func (r ResponseImmediately) IsNull() bool
func (ResponseImmediately) SetAccepted ¶
func (r ResponseImmediately) SetAccepted()
func (ResponseImmediately) SetBadRequest ¶
func (r ResponseImmediately) SetBadRequest(message string)
func (ResponseImmediately) SetCodeAndMsg ¶
func (r ResponseImmediately) SetCodeAndMsg(code int, message string)
func (ResponseImmediately) SetNotFound ¶
func (r ResponseImmediately) SetNotFound(message string)
func (ResponseImmediately) SetServerError ¶
func (r ResponseImmediately) SetServerError(message string)
func (ResponseImmediately) SetSuccess ¶
func (r ResponseImmediately) SetSuccess()
type SQLSearchReq ¶
type SQLSearchReq struct {
Q string `json:"q" form:"q"`
}
func (*SQLSearchReq) AddQ ¶
func (c *SQLSearchReq) AddQ(k, v string)
func (*SQLSearchReq) QToMap ¶
func (c *SQLSearchReq) QToMap() map[string]interface{}
func (*SQLSearchReq) SearchFilter ¶
func (c *SQLSearchReq) SearchFilter(fuzzy bool) interface{}
type SQLSortReq ¶
type SQLSortReq struct {
Sort string `json:"sort" form:"sort"`
}
func (*SQLSortReq) SortFilter ¶
func (c *SQLSortReq) SortFilter() interface{}
type SearchReqInterface ¶
type SearchReqInterface interface {
SearchFilter(fuzzy bool) interface{}
}
type SortReqInterface ¶
type SortReqInterface interface {
SortFilter() interface{}
}
type WSearchReq ¶
type WSearchReq struct {
W string `json:"w" form:"w"`
}
func (*WSearchReq) WordFilter ¶
func (c *WSearchReq) WordFilter(fuzzy bool, fields ...string) interface{}
type WordReqInterface ¶
Click to show internal directories.
Click to hide internal directories.