[feat] 统一 ORM 扩展条件入口

This commit is contained in:
what 2024-07-04 15:49:39 +08:00
parent ba0d080e14
commit 57904565f3
2 changed files with 4 additions and 6 deletions

View File

@ -1,9 +1,5 @@
package base package base
import (
"git.fsdpf.net/go/contracts"
)
type ResQueryExtend struct { type ResQueryExtend struct {
Uuid string `db:"uuid"` Uuid string `db:"uuid"`
Category int64 `db:"category"` // 类型, 0=排序,1=分组 Category int64 `db:"category"` // 类型, 0=排序,1=分组
@ -17,5 +13,3 @@ type ResQueryExtend struct {
} }
type GetResQueryExtends func(categoryUuid string, category int64) []ResQueryExtend type GetResQueryExtends func(categoryUuid string, category int64) []ResQueryExtend
type GetOrderByResQueryExtends func(items ...ResQueryExtend) contracts.OrderBy
type GetGroupByResQueryExtends func(items ...ResQueryExtend) contracts.GroupBy

4
orm.go
View File

@ -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 NewOrm func(res req.Resource, tx *db.Transaction) Orm
type GetOrmConditions func(categoryUuid string, opts ...condition.Option) *condition.Condition type GetOrmConditions func(categoryUuid string, opts ...condition.Option) *condition.Condition
type GetOrmOrderBy func(categoryUuid string) []OrderBy
type GetOrmGroupBy func(categoryUuid string) []GroupBy