diff --git a/condition.go b/condition.go index 2b6ba40..a69ce82 100644 --- a/condition.go +++ b/condition.go @@ -16,10 +16,10 @@ const ( //"colum:user;opr:in;split:sting;sep:,"` queryConditionColum = "colum" - queryConditionOpr = "opr" + queryConditionOpr = "op" queryConditionSplit = "split" queryConditionSep = "sep" - queryConditionPattern = "pattern" + queryConditionPattern = "patten" // pattern: 会把结构体的值替换pattern字符串中的? // pattern:?% diff --git a/condition_test.go b/condition_test.go index 2d7f29f..65476f0 100644 --- a/condition_test.go +++ b/condition_test.go @@ -12,7 +12,7 @@ type areaQueryBody struct { nameIDQueryBody `cond:"embedded"` //Name string `cond:"colum:name;opr:like;pattern:%%?%%"` //ID []int `cond:"colum:id;opr:in"` - Type string `cond:"colum:type;opr:in;split:int;sep:,"` + Type string `cond:"colum:type;op:in;split:int;sep:,"` Start string `cond:"colum:created_at;opr:>"` Desc string `cond:"colum:desc;opr:in"` // split默认值string,sep默认值, } @@ -27,7 +27,7 @@ type locationQueryBody struct { } type nameIDQueryBody struct { - Name string `cond:"colum:name;opr:like;pattern:%%?%%"` + Name string `cond:"colum:name;opr:like;patten:%%?%%"` ID []int `cond:"colum:id;opr:in"` }