[feat] 统一 orm 入口
This commit is contained in:
@@ -184,3 +184,31 @@ type QueryWithRecursive interface {
|
||||
ToQueryBuilder(*db.Builder, Model) (*db.Builder, any)
|
||||
ToTreeData(any) any
|
||||
}
|
||||
|
||||
// @title 创建关联模型
|
||||
// @param t 关联类型
|
||||
// @param m 关联模型
|
||||
// @param rResource 链接父模型
|
||||
// @param rField 连接父模型字段, 如 xx_id
|
||||
// @param rForeignKey 关联外键, 如 id
|
||||
type NewOrmRelation func(t RelationType, m Model, rResource, rField, rForeignKey string) Model
|
||||
|
||||
type NewOrmJoin func(t RelationType, res Resource, alias, rResource, rField, rForeignKey string) Join
|
||||
|
||||
type NewOrmCondition func(typ ConditionType, describe string) Condition
|
||||
|
||||
type NewOrmConditionExpr func(rResource, rField, token string, operator ConditionOperator, tType ConditionTokenType, ignoreEmptyParma bool) ConditionExpr
|
||||
|
||||
type NewOrmConditionFuncExpr func(rResource, rField, token string, operator ConditionOperator, tType ConditionTokenType, ignoreEmptyParma bool, fn, fnParam string) ConditionExpr
|
||||
|
||||
type NewOrmQueryWithRecursive func(pField, cField string, root any, isWithoutCondition bool, depth int) QueryWithRecursive
|
||||
|
||||
type NewOrmOrderBy func(sql string, direction OrderByDirection) OrderBy
|
||||
|
||||
type NewOrmGroupBy func(sql string) GroupBy
|
||||
|
||||
type NewOrmModel func(res Resource, code, name string) Model
|
||||
|
||||
type NewOrm func(res Resource, tx *db.Transaction) Orm
|
||||
|
||||
type GetOrmConditionByRes func(categoryUuid string, describe string) Condition
|
||||
|
||||
Reference in New Issue
Block a user