From fb154c64221efb9261fc48198eea4135ac27b2e2 Mon Sep 17 00:00:00 2001 From: what Date: Mon, 26 Feb 2024 22:32:27 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E8=B0=83=E6=95=B4=20ResQueryExtend=20?= =?UTF-8?q?=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 | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/base/res_query_extend.go b/base/res_query_extend.go index 3761134..e671301 100644 --- a/base/res_query_extend.go +++ b/base/res_query_extend.go @@ -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