diff --git a/orm.go b/orm.go index 82c074e..0b4d085 100644 --- a/orm.go +++ b/orm.go @@ -116,11 +116,9 @@ type Join interface { } type Model interface { Relation + ModelParam GetCode() string GetPrimaryKey() string - GetParam(k string) GlobalParams - GetParamWithPrefix(k string, prefix string) GlobalParams - GetGlobalParamsUser() User GetQueryFieldsStruct(extends ...reflect.StructField) any GetQueryFieldsSliceStruct(fields ...reflect.StructField) any GetAttribute() map[string]any @@ -148,6 +146,11 @@ type Model interface { // Exists() (bool, error) } +type ModelParam interface { + GetParam(k string) GlobalParams + GetGlobalParamsUser() User +} + type Condition interface { Type() ConditionType IsEmpty() bool @@ -170,12 +173,12 @@ type ConditionExpr interface { SetMatchPrefix(string) ConditionExpr AppendTo(Condition) - ToSql(m Model) db.Expression + ToSql(m ModelParam) db.Expression GetTokenName() string GetTokenType() ConditionTokenType - GetTokenValue(Model) any - GetTokenSqlValue(Model) string - IsIgnoreEmptyParma(Model) bool + GetTokenValue(ModelParam) any + GetTokenSqlValue(ModelParam) string + IsIgnoreEmptyParma(ModelParam) bool } type QueryField interface {