[feat] 命名更新
This commit is contained in:
parent
9e1a2c4e24
commit
9683179bf8
@ -198,7 +198,7 @@ func (this ConditionExpr) IsIgnoreEmptyParma(m contracts.ModelParam) bool {
|
|||||||
return false
|
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{
|
return &ConditionExpr{
|
||||||
operator: operator,
|
operator: operator,
|
||||||
field: rField,
|
field: rField,
|
||||||
|
@ -26,7 +26,7 @@ func TestEngine(t *testing.T) {
|
|||||||
|
|
||||||
cond1 := condition.New(contracts.ConditionType_AND, "条件1")
|
cond1 := condition.New(contracts.ConditionType_AND, "条件1")
|
||||||
|
|
||||||
cond1.SetExpr(condition.NewExpr(
|
cond1.SetExpr(condition.NewConditionExpr(
|
||||||
"TestTable", "age", "age",
|
"TestTable", "age", "age",
|
||||||
contracts.ConditionOperator_EQ, contracts.ConditionTokenType_PARAM,
|
contracts.ConditionOperator_EQ, contracts.ConditionTokenType_PARAM,
|
||||||
false, "", "",
|
false, "", "",
|
||||||
@ -65,7 +65,7 @@ func TestRelationEngine(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cond1 := condition.New(contracts.ConditionType_AND, "条件1").
|
cond1 := condition.New(contracts.ConditionType_AND, "条件1").
|
||||||
SetExpr(condition.NewExpr(
|
SetExpr(condition.NewConditionExpr(
|
||||||
"TestTable", "age", "age",
|
"TestTable", "age", "age",
|
||||||
contracts.ConditionOperator_EQ, contracts.ConditionTokenType_PARAM,
|
contracts.ConditionOperator_EQ, contracts.ConditionTokenType_PARAM,
|
||||||
false, "", "",
|
false, "", "",
|
||||||
@ -77,12 +77,12 @@ func TestRelationEngine(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
cond2 := condition.New(contracts.ConditionType_OR, "条件2").
|
cond2 := condition.New(contracts.ConditionType_OR, "条件2").
|
||||||
SetExpr(condition.NewExpr(
|
SetExpr(condition.NewConditionExpr(
|
||||||
"TestTableA", "age", "age",
|
"TestTableA", "age", "age",
|
||||||
contracts.ConditionOperator_EQ, contracts.ConditionTokenType_PARAM,
|
contracts.ConditionOperator_EQ, contracts.ConditionTokenType_PARAM,
|
||||||
false, "", "",
|
false, "", "",
|
||||||
)).
|
)).
|
||||||
SetExpr(condition.NewExpr(
|
SetExpr(condition.NewConditionExpr(
|
||||||
"TestTable", "age", "age",
|
"TestTable", "age", "age",
|
||||||
contracts.ConditionOperator_EQ, contracts.ConditionTokenType_PARAM,
|
contracts.ConditionOperator_EQ, contracts.ConditionTokenType_PARAM,
|
||||||
false, "", "",
|
false, "", "",
|
||||||
|
Loading…
Reference in New Issue
Block a user