From 68cffa4d7dd4768459ff9077bf61335f9a4eba2c Mon Sep 17 00:00:00 2001 From: what Date: Tue, 20 Feb 2024 17:57:04 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E6=96=B0=E5=A2=9E=20ResQueryOrder=20R?= =?UTF-8?q?esQueryGroup=20=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base/res_query_extend.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 base/res_query_extend.go diff --git a/base/res_query_extend.go b/base/res_query_extend.go new file mode 100644 index 0000000..3761134 --- /dev/null +++ b/base/res_query_extend.go @@ -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