2020-01-14 22:22:34 -05:00
|
|
|
package model
|
2016-03-02 09:33:49 -05:00
|
|
|
|
2016-03-18 11:33:50 -04:00
|
|
|
import "errors"
|
|
|
|
|
|
|
|
|
|
var (
|
2016-03-23 16:30:38 -04:00
|
|
|
ErrNotFound = errors.New("data not found")
|
2016-03-18 11:33:50 -04:00
|
|
|
)
|
|
|
|
|
|
2020-01-15 23:49:20 -05:00
|
|
|
// Filters use the same operators as Beego ORM: See https://beego.me/docs/mvc/model/query.md#operators
|
|
|
|
|
// Ex: var q = QueryOptions{Filters: Filters{"name__istartswith": "Deluan","age__gt": 25}}
|
|
|
|
|
// All conditions will be ANDed together
|
|
|
|
|
// TODO Implement filter in repositories' methods
|
|
|
|
|
type Filters map[string]interface{}
|
|
|
|
|
|
2016-03-03 22:44:28 -05:00
|
|
|
type QueryOptions struct {
|
2020-01-15 23:49:20 -05:00
|
|
|
SortBy string
|
|
|
|
|
Desc bool
|
|
|
|
|
Offset int
|
|
|
|
|
Size int
|
|
|
|
|
Filters Filters
|
2016-03-03 22:44:28 -05:00
|
|
|
}
|