[feat] 新增 ResQueryOrder ResQueryGroup 类型

This commit is contained in:
what 2024-02-20 17:57:04 +08:00
parent c6f99dce1c
commit 68cffa4d7d

30
base/res_query_extend.go Normal file
View File

@ -0,0 +1,30 @@
package base
type ResQueryExtend struct {
Uuid string `db:"uuid"`
Category int64 `db:"category"` // 类型, 0=排序,1=分组
CategoryUuid string `db:"category_uuid"` // 所属UUID
Type string `db:"type"` // 表达式类型. sql/field
Expr string `db:"expr"` // 表达式
Extra map[string]any `db:"extra"` // 扩展配置
Serial int64 `db:"serial"` // 权重
UpdatedAt string `db:"updated_at"`
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