diff --git a/condition_expr.go b/condition_expr.go index ea3c0fd..bf191a3 100644 --- a/condition_expr.go +++ b/condition_expr.go @@ -198,7 +198,7 @@ func (this ConditionExpr) IsIgnoreEmptyParma(m contracts.ModelParam) bool { return false } -func NewExpr(rResource, rField, token string, operator contracts.ConditionOperator, tType contracts.ConditionTokenType, ignoreEmptyParma bool, fn, fnParam string) contracts.ConditionExpr { +func NewConditionExpr(rResource, rField, token string, operator contracts.ConditionOperator, tType contracts.ConditionTokenType, ignoreEmptyParma bool, fn, fnParam string) contracts.ConditionExpr { return &ConditionExpr{ operator: operator, field: rField, diff --git a/engine/engine_test.go b/engine/engine_test.go index 1c50647..349103f 100644 --- a/engine/engine_test.go +++ b/engine/engine_test.go @@ -26,7 +26,7 @@ func TestEngine(t *testing.T) { cond1 := condition.New(contracts.ConditionType_AND, "条件1") - cond1.SetExpr(condition.NewExpr( + cond1.SetExpr(condition.NewConditionExpr( "TestTable", "age", "age", contracts.ConditionOperator_EQ, contracts.ConditionTokenType_PARAM, false, "", "", @@ -65,7 +65,7 @@ func TestRelationEngine(t *testing.T) { } cond1 := condition.New(contracts.ConditionType_AND, "条件1"). - SetExpr(condition.NewExpr( + SetExpr(condition.NewConditionExpr( "TestTable", "age", "age", contracts.ConditionOperator_EQ, contracts.ConditionTokenType_PARAM, false, "", "", @@ -77,12 +77,12 @@ func TestRelationEngine(t *testing.T) { }) cond2 := condition.New(contracts.ConditionType_OR, "条件2"). - SetExpr(condition.NewExpr( + SetExpr(condition.NewConditionExpr( "TestTableA", "age", "age", contracts.ConditionOperator_EQ, contracts.ConditionTokenType_PARAM, false, "", "", )). - SetExpr(condition.NewExpr( + SetExpr(condition.NewConditionExpr( "TestTable", "age", "age", contracts.ConditionOperator_EQ, contracts.ConditionTokenType_PARAM, false, "", "",