Remove Alpha from QueryOptions. Also add Filter, not implemented yet

This commit is contained in:
Deluan
2020-01-15 23:49:20 -05:00
parent 0a56fd8752
commit ca04a919ad
2 changed files with 15 additions and 9 deletions
+11 -5
View File
@@ -6,10 +6,16 @@ var (
ErrNotFound = errors.New("data not found")
)
// 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{}
type QueryOptions struct {
SortBy string
Alpha bool
Desc bool
Offset int
Size int
SortBy string
Desc bool
Offset int
Size int
Filters Filters
}