refactor: add filters
This commit is contained in:
+2
-5
@@ -3,19 +3,16 @@ package model
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/Masterminds/squirrel"
|
||||
"github.com/deluan/rest"
|
||||
)
|
||||
|
||||
// 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 QueryOptions struct {
|
||||
Sort string
|
||||
Order string
|
||||
Max int
|
||||
Offset int
|
||||
Filters map[string]interface{}
|
||||
Filters squirrel.Sqlizer
|
||||
}
|
||||
|
||||
type ResourceRepository interface {
|
||||
|
||||
Reference in New Issue
Block a user