From 57904565f37ec51066e0be2eab9792af9e1c16c2 Mon Sep 17 00:00:00 2001 From: what Date: Thu, 4 Jul 2024 15:49:39 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E7=BB=9F=E4=B8=80=20ORM=20=E6=89=A9?= =?UTF-8?q?=E5=B1=95=E6=9D=A1=E4=BB=B6=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base/res_query_extend.go | 6 ------ orm.go | 4 ++++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/base/res_query_extend.go b/base/res_query_extend.go index e671301..167ba4d 100644 --- a/base/res_query_extend.go +++ b/base/res_query_extend.go @@ -1,9 +1,5 @@ package base -import ( - "git.fsdpf.net/go/contracts" -) - type ResQueryExtend struct { Uuid string `db:"uuid"` Category int64 `db:"category"` // 类型, 0=排序,1=分组 @@ -17,5 +13,3 @@ type ResQueryExtend struct { } type GetResQueryExtends func(categoryUuid string, category int64) []ResQueryExtend -type GetOrderByResQueryExtends func(items ...ResQueryExtend) contracts.OrderBy -type GetGroupByResQueryExtends func(items ...ResQueryExtend) contracts.GroupBy diff --git a/orm.go b/orm.go index d43cd9c..b3c9c1c 100644 --- a/orm.go +++ b/orm.go @@ -140,3 +140,7 @@ type NewOrmModel func(res req.Resource, code, name string) Model type NewOrm func(res req.Resource, tx *db.Transaction) Orm type GetOrmConditions func(categoryUuid string, opts ...condition.Option) *condition.Condition + +type GetOrmOrderBy func(categoryUuid string) []OrderBy + +type GetOrmGroupBy func(categoryUuid string) []GroupBy