Browse Source

修改bug

yjp 9 months ago
parent
commit
6f3497d071

+ 4 - 0
convenient/data_containers/query_rule/query_rule.yaml

@@ -22,4 +22,8 @@ spec:
         type: text
         comment: 规则
         not_null: true
+      - name: enabled
+        type: boolean
+        comment: 是否启用
+        not_null: true
 

+ 1 - 1
convenient/domain/query_rule/api.go

@@ -66,7 +66,7 @@ func (simple *Simple) bind(binder *binding.Binder) {
 					TableName: domain.TableName(simple.Schema, &Entity{}),
 					Conditions: sql.NewConditions().
 						Equal(ColumnScope, queryRuleEntity.Scope).
-						Equal(ColumnScope, queryRuleEntity.DomainName),
+						Equal(ColumnDomainName, queryRuleEntity.DomainName),
 				})
 				if err != nil {
 					return nil, err

+ 1 - 1
convenient/domain/query_rule/query_rule_parser.go

@@ -107,7 +107,7 @@ func Lint(ruleStr string) error {
 	r := new(Rule)
 	err := json.Unmarshal([]byte(ruleStr), r)
 	if err != nil {
-		return err
+		return errors.New(err.Error())
 	}
 
 	return r.Check()