31 lines
1.4 KiB
Go
31 lines
1.4 KiB
Go
|
package helper
|
||
|
|
||
|
import (
|
||
|
"git.fsdpf.net/go/contracts"
|
||
|
"git.fsdpf.net/go/contracts/base"
|
||
|
)
|
||
|
|
||
|
// @title 创建关联模型
|
||
|
// @param t 关联类型
|
||
|
// @param m 关联模型
|
||
|
// @param rResource 链接父模型
|
||
|
// @param rField 连接父模型字段, 如 xx_id
|
||
|
// @param rForeignKey 关联外键, 如 id
|
||
|
type NewOrmRelationModel func(t contracts.RelationType, m contracts.Model, rResource, rField, rForeignKey string) contracts.Model
|
||
|
|
||
|
type NewOrmJoin func(t contracts.RelationType, res contracts.Resource, alias, rResource, rField, rForeignKey string) contracts.Join
|
||
|
|
||
|
type NewOrmCondition func(typ contracts.ConditionType, describe string) contracts.Condition
|
||
|
|
||
|
type NewOrmConditionExpr func(rResource, rField, token string, operator contracts.ConditionOperator, tType contracts.ConditionTokenType, ignoreEmptyParma bool) contracts.ConditionExpr
|
||
|
|
||
|
type NewOrmConditionFuncExpr func(rResource, rField, token, fn, fnParam, string, operator contracts.ConditionOperator, tType contracts.ConditionTokenType, ignoreEmptyParma bool) contracts.ConditionExpr
|
||
|
|
||
|
type NewOrmConditionByRes func(items []base.ResCondition) contracts.Condition
|
||
|
|
||
|
type NewOrmQueryField func(rField base.ResField, t contracts.QueryDataType, alias string, options int) contracts.QueryField
|
||
|
|
||
|
type NewOrderBy func(sql string, direction contracts.OrderByDirection) contracts.OrderBy
|
||
|
|
||
|
type NewGroupBy func(sql string) contracts.GroupBy
|