Documentation ¶
Index ¶
- func GetAll(c *beego.Controller, model interface{}, contains interface{}, ...) (err error)
- func GetAllByFilter(model interface{}, contains interface{}, f *Filter) (err error)
- func GetAllByFilterWithTotal(model interface{}, contains interface{}, f *Filter) (total int64, err error)
- func GetAllWithTotal(c *beego.Controller, model interface{}, contains interface{}, ...) (total int64, err error)
- type Filter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAll ¶
func GetAll(c *beego.Controller, model interface{}, contains interface{}, defaultLimit int64) (err error)
封装一层 getAll 获取列表 ,方便使用
func GetAllByFilter ¶
func GetAllByFilterWithTotal ¶
func GetAllWithTotal ¶
func GetAllWithTotal(c *beego.Controller, model interface{}, contains interface{}, defaultLimit int64) (total int64, err error)
Types ¶
type Filter ¶
type Filter struct { Fields []string // 字段 Order []string // 排序 : -id id Where map[string][]interface{} // id:1;user_id:in1,2,3|<=2 Limit int64 // Offset int64 // }
func BuildFilter ¶
func BuildFilter(c *beego.Controller, defaultLimit int64) (f *Filter, err error)
根据输入生成过滤条件 query=id:1;type:in1,3,5 & order=-ascId,descType & limit=0 & offset=0
Click to show internal directories.
Click to hide internal directories.