This commit is contained in:
Eden Kirin
2024-06-26 11:41:01 +02:00
parent 326866dc49
commit 43824af97c
2 changed files with 76 additions and 3 deletions

View File

@ -46,7 +46,7 @@ type MyModelFilter struct {
Id *uuid.UUID `filterfield:"field=id,operator=EQ"`
Ids *[]uuid.UUID `filterfield:"field=id,operator=IN"`
Value *string `filterfield:"field=value,operator=EQ"`
Cnt *int `filterfield:"field=cnt,operator=GT"`
CntGT *int `filterfield:"field=cnt,operator=GT"`
}
func TestListMethod(t *testing.T) {
@ -198,7 +198,7 @@ func TestListMethod(t *testing.T) {
filter := MyModelFilter{
Id: &id,
Value: &value,
Cnt: &count,
CntGT: &count,
}
sql := "SELECT * FROM my_models WHERE my_models.id = $1 AND my_models.value = $2 AND my_models.cnt > $3"
@ -226,7 +226,7 @@ func TestListMethod(t *testing.T) {
filter := MyModelFilter{
Id: &id,
Value: &value,
Cnt: &count,
CntGT: &count,
}
options := ListOptions{
Pagination: &Pagination{