Documentation ¶
Index ¶
Constants ¶
View Source
const ( // GT ... GT = "gt" // GE ... GE = "ge" // LT ... LT = "lt" // LE ... LE = "le" // IN ... IN = "in" // NN ... NN = "not_in" // LIKE ... LIKE = "like" // ILIKE ... ILIKE = "ilike" // EQ ... EQ = "eq" )
verb
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DBSupplier ¶
type PageWrap ¶
type PageWrap struct { Data interface{} `json:"data"` Total int64 `json:"total"` Size int64 `json:"size"` Page int64 `json:"page"` Pages int64 `json:"pages"` }
PageWrap ...
type PagedQueryFunc ¶
func BuildPagedQuery ¶
func BuildPagedQuery(entity interface{}) PagedQueryFunc
func BuildPagedQueryWithDB ¶
func BuildPagedQueryWithDB(db *gorm.DB, entity interface{}) PagedQueryFunc
func BuildPagedQueryWithDBSupplier ¶
func BuildPagedQueryWithDBSupplier(supplier DBSupplier, entity interface{}) PagedQueryFunc
BuildPagedQueryWithDBSupplier eg: entity: &Person{} PagedQueryFunc returns []*Person
type QReq ¶
type QReq struct { // 页码 Page int64 `json:"page"` // 每页显示条数 Size int64 `json:"size"` // 显示的字段列表. 例如: ["name","age","created_at"],为空,则默认显示所有0 Select []string `json:"select"` // 排序, 例如: ["-created_at"] 则表示按照 created_at 降序排列, 默认按照: ["-created_at"] 排序 Sort []string `json:"sort"` // 查询条件,例如: GET /v1/logs?q["level"]=DEBUG Q map[string]string `json:"q"` }
QReq ...
type StringFilter ¶
func ContainStringFilter ¶
func ContainStringFilter(strs ...string) StringFilter
ContainStringFilter ...
func ExcludeStringFilter ¶
func ExcludeStringFilter(strs ...string) StringFilter
ExcludeStringFilter ...
func (StringFilter) Do ¶
func (f StringFilter) Do(s string) bool
Click to show internal directories.
Click to hide internal directories.