Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support multi-params configuration of rule #117

Closed
drivebyer opened this issue Nov 30, 2021 · 1 comment
Closed

support multi-params configuration of rule #117

drivebyer opened this issue Nov 30, 2021 · 1 comment
Assignees
Labels
feature not_compatible not compatible old version ui this issue is is related to the FE
Milestone

Comments

@drivebyer
Copy link
Contributor

drivebyer commented Nov 30, 2021

背景

  1. support MySQL index optimize #55 中需要新增 3 个配置,层级不同,无法通过 3 条规则友好的表示
  2. 当前规则只支持配置 1 个规则值,无法支持复杂规则的自定义
  3. 当前规则值以字符串的形式展示,用户在修改规则值时,缺少类型限制(用户可能在规则值中填写任何值)
@drivebyer drivebyer added this to the v1.2112.0 milestone Nov 30, 2021
@drivebyer drivebyer self-assigned this Nov 30, 2021
@sjjian sjjian assigned sjjian and unassigned sjjian and drivebyer Nov 30, 2021
@sjjian sjjian added the ui this issue is is related to the FE label Nov 30, 2021
@sjjian sjjian added the not_compatible not compatible old version label Dec 1, 2021
@sjjian
Copy link
Member

sjjian commented Dec 1, 2021

页面变更

  1. 查看规则
  2. 审核模板编辑界面
    image
  3. 展示规则描述的内容,不展示规则名称,这个值对用户目前没有参考意义,仅是后端的主键;
  4. 页面布局
规则:避免使用不必要的内置函数
规则分类:DML 规范
数据库类型: MySQL

规则等级 :

规则配置1:
规则配置2:

接口变更

涉及的查询接口

  1. [get]/v1/rules 规则列表接口
  2. [get]/v1/rule_templates/{rule_template_name}/ 审核模板详情

查询接口变更

RuleReqV1 结构的 value 字段弃用,改为 params 字段,对应的是结构RuleParamResV1 列表,对应下面字段:

  1. key :该配置项的主键
  2. value:该配置项的值
  3. desc:该配置项的描述,对应页面的展示
  4. type:value对应的值类型,在页面进行验证,bool,int,string

涉及的修改接口

  1. [post]/v1/rule_templates 添加规则模板
  2. [patch]/v1/rule_templates/{rule_template_name}/ 修改规则模板

修改接口的变更

RuleReqV1结构体的value 字段弃用,改为params 字段,对应的是结构RuleParamResV1列表,对应下面字段:

  1. key :该配置项的主键
  2. value:该配置项的值

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature not_compatible not compatible old version ui this issue is is related to the FE
Projects
None yet
Development

No branches or pull requests

2 participants