Documentation
¶
Overview ¶
Package query 查询操作
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Paging ¶
func Paging[T any](ctx *web.Context, l *Limit, sql *sqlbuilder.SelectStmt) web.Responser
Paging 返回分页对象
T 为返回给客户端数据元素项的类型,必须为非指针类型。最终给客户的数据为 []*T。
Types ¶
type DateRange ¶
DateRange 时间范围。
将查询参数中的 xx-xx 转换成两个时间戳。
其中 0 表示未传递过来。
func (*DateRange) UnmarshalQuery ¶
type Limit ¶
type Limit struct {
Page int `query:"page,0"` // 请求的页码,从 0 开始。
Size int `query:"size,20"` // 每页的数量
}
Limit 分页查询中总会带的查询参数
func (*Limit) CTXSanitize ¶
func (l *Limit) CTXSanitize(v *web.Validation)
Click to show internal directories.
Click to hide internal directories.