beeorm

package
v0.0.0-...-3b54ddd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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 GetAllByFilter(model interface{}, contains interface{}, f *Filter) (err error)

func GetAllByFilterWithTotal

func GetAllByFilterWithTotal(model interface{}, contains interface{}, f *Filter) (total int64, err error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL