Documentation
¶
Index ¶
- func AES(ctx context.Context, data any) (str string)
- func MiddlewareHandlerResponse(r *ghttp.Request)
- func SetIsAll(tx *gdb.Model, in *PageLstReq) (result *gdb.Model)
- func SetOrder(tx *gdb.Model, in *PageLstReq) (result *gdb.Model)
- func SetSimple(tx *gdb.Model, in *PageLstReq) (result *gdb.Model)
- type DefaultHandlerResponse
- type PageLstReq
- type PageLstRes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MiddlewareHandlerResponse ¶
MiddlewareHandlerResponse is the default middleware handling handler response object and its error.
Types ¶
type DefaultHandlerResponse ¶
type DefaultHandlerResponse struct {
Code int `json:"code" dc:"Error code"`
Message string `json:"message" dc:"Error message"`
Details interface{} `json:"details,omitempty" dc:"Error details"`
Data interface{} `json:"data" dc:"Result data for certain request according API definition"`
}
DefaultHandlerResponse is the default implementation of HandlerResponse.
type PageLstReq ¶
type PageLstReq struct {
Page int `p:"page" v:"page @integer|min:1#页码必填" d:"1" dc:"页码"` // 页码
LimitNum int `p:"limit" v:"pageSize @integer|min:1#每页数量必填" d:"10" dc:"每页数量"` // 每页数量
Keywords string `p:"keywords" dc:"模糊搜索内容"` // 搜索内容
Wheres *gjson.Json `p:"wheres" dc:"搜索条件" d:"{}"`
Order *gjson.Json `p:"order" dc:"排序条件" d:"{}"`
}
func NewPageLstReq ¶
func NewPageLstReq() *PageLstReq
func (*PageLstReq) Limit ¶
func (r *PageLstReq) Limit() int
func (*PageLstReq) Offset ¶
func (r *PageLstReq) Offset() int
func (*PageLstReq) SearchStr ¶
func (r *PageLstReq) SearchStr() string
func (*PageLstReq) SearchStrM ¶
func (r *PageLstReq) SearchStrM() string
func (*PageLstReq) SearchStrOther ¶
func (r *PageLstReq) SearchStrOther(str string) string
type PageLstRes ¶
type PageLstRes[T any] struct { Total int `json:"total" dc:"总数"` // 总数 List []T `json:"list" dc:"列表"` // 列表 }
func NewPageLstRes ¶
func NewPageLstRes[T any]() *PageLstRes[T]
Click to show internal directories.
Click to hide internal directories.