[feat] 调整 ResQueryExtend 类型

This commit is contained in:
what 2024-02-26 22:32:27 +08:00
parent b4c13f60d2
commit fb154c6422

View File

@ -1,5 +1,9 @@
package base
import (
"git.fsdpf.net/go/contracts"
)
type ResQueryExtend struct {
Uuid string `db:"uuid"`
Category int64 `db:"category"` // 类型, 0=排序,1=分组
@ -12,19 +16,6 @@ type ResQueryExtend struct {
CreatedAt string `db:"created_at"`
}
type ResQueryOrder struct {
Uuid string
Type string // 表达式类型. sql/field
Expr string // 表达式
Direction string // 排序方式
}
type ResQueryGroup struct {
Uuid string
Type string // 表达式类型. sql/field
Expr string // 表达式
}
type GetResQueryExtends func(categoryUuid string, category int64) []ResQueryExtend
type GetResQueryOrders func(categoryUuid string) []ResQueryOrder
type GetResQueryGroups func(categoryUuid string) []ResQueryGroup
type GetOrderByResQueryExtends func(items ...ResQueryExtend) contracts.OrderBy
type GetGroupByResQueryExtends func(items ...ResQueryExtend) contracts.GroupBy