[feat] 调整 接口文件

This commit is contained in:
2024-05-08 22:58:27 +08:00
parent 91d88930c2
commit 50a0a1a85c
5 changed files with 62 additions and 63 deletions

View File

@@ -4,7 +4,6 @@ import (
"testing"
"git.fsdpf.net/go/condition"
"git.fsdpf.net/go/condition/contracts"
"git.fsdpf.net/go/req"
)
@@ -24,11 +23,11 @@ func TestEngine(t *testing.T) {
g: req.NewGlobalParam(`{"age": 30}`, nil),
}
cond1 := condition.New(contracts.AND, "条件1")
cond1 := condition.New(condition.AND, "条件1")
cond1.SetExpr(condition.NewExpr(
"TestTable", "age", "age",
contracts.EQ, contracts.PARAM,
condition.EQ, condition.PARAM,
false, "", "",
))
@@ -67,10 +66,10 @@ func TestRelationEngine(t *testing.T) {
},
}
cond1 := condition.New(contracts.AND, "条件1").
cond1 := condition.New(condition.AND, "条件1").
SetExpr(condition.NewExpr(
"TestTable", "age", "age",
contracts.EQ, contracts.PARAM,
condition.EQ, condition.PARAM,
false, "", "",
))
@@ -79,15 +78,15 @@ func TestRelationEngine(t *testing.T) {
return nil
})
cond2 := condition.New(contracts.OR, "条件2").
cond2 := condition.New(condition.OR, "条件2").
SetExpr(condition.NewExpr(
"TestTableA", "age", "age",
contracts.EQ, contracts.PARAM,
condition.EQ, condition.PARAM,
false, "", "",
)).
SetExpr(condition.NewExpr(
"TestTable", "age", "age",
contracts.EQ, contracts.PARAM,
condition.EQ, condition.PARAM,
false, "", "",
))