From 9683179bf84b84a1641d9e3b5a0bbd739ae668e1 Mon Sep 17 00:00:00 2001 From: what Date: Thu, 20 Jul 2023 15:04:07 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E5=91=BD=E5=90=8D=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- condition_expr.go | 2 +- engine/engine_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) 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, "", "",