获取CC规则组列表
get:/v1/cc-rules
integer:page=1#当前页码
integer:limit=10#单页显示数量
integer:internal_self#置为1时显示内置及自己的规则组
integer:internal#置为1时,只显示内置规则组
boolean:enable#显示禁用或启用的规则组
boolean:is_show#是否显示
<<<
返回结果
{
"code": 0,
"count": 1,
"data": [
{
"c.uid": 2,
"create_at": null,
"create_at2": "2021-11-25 18:09:35",
"data": "[{\"matcher\": \"10021\", \"action\": \"ipset\", \"state\": true, \"filter1\": \"10021\", \"filter2_name\": \"\", \"filter2\": \"\", \"matcher_name\": \"\\u5339\\u914dapi\", \"filter1_name\": \"\\u9a8c\\u8bc1\\u7801\"}]",
"des": "",
"enable": 1,
"id": 10021,
"internal": 0,
"is_show": 1,
"name": "验证码",
"sort": 100,
"state": null,
"task_id": null,
"uid": 2,
"update_at": null,
"update_at2": "2021-11-25 18:09:35",
"username": "jason",
"version": 1
}
]
}
新增CC规则组
post:/v1/cc-rules
*string:name#规则组名称
integer:sort=100#排序
des#备注
*json:data#数据类型为数组,数组元素格式为{"action":"ipset","matcher":"1","state":true,"filter1":"1","filter2":""}。action可选值为ipset, exit, log,matcher为匹配器id,filter1和filter2为过滤器id,state为状态,表示是否启用
boolean:enable#禁用或启用,默认为启用
boolean:is_show#是否显示,默认为显示
<<<
返回结果
{
"code":0,
"data": "1",
"msg": "cc规则添加成功"
}
<<<
提交内容
{
"name": "5秒验证",
"data": [{
"matcher_name": "中国地区",
"filter1_name": "5秒验证",
"filter2_name": "",
"matcher": "10022",
"filter1": "10022",
"filter2": "",
"action": "ipset",
"state": true
}],
"sort": "100",
"is_show": true
}
批量修改CC规则组
put:/v1/cc-rules
integer:id#规则组id
string:name#规则组名称
integer:sort=100#排序
des#备注
json:data#数据类型为数组,数组元素格式为{"action":"ipset","matcher":"1","state":true,"filter1":"1","filter2":""}。action可选值为ipset, exit, log,matcher为匹配器id,filter1和filter2为过滤器id,state为状态,表示是否启用
boolean:enable#禁用或启用,默认为启用
boolean:is_show#是否显示,默认为显示
<<<
返回结果
{
"code":0,
"data": "",
"msg": "更新cc规则成功"
}
<<<
提交内容
[{
"id": 1,
"enable": 0
}, {
"id": 2,
"enable": 0
}]
获取单个CC规则组
get:/v1/cc-rules/<规则组ID>
*string:id=默认值#说明文字
name#说明文字
<<<
返回结果
{
"code": 0,
"data": {
"create_at": null,
"data": "[{\"matcher\": \"10021\", \"action\": \"ipset\", \"state\": true, \"filter1\": \"10021\", \"filter2_name\": \"\", \"filter2\": \"\", \"matcher_name\": \"\\u5339\\u914dapi\", \"filter1_name\": \"\\u9a8c\\u8bc1\\u7801\"}]",
"des": "",
"enable": 1,
"id": 10021,
"internal": 0,
"is_show": 1,
"name": "验证码",
"sort": 100,
"task_id": null,
"uid": 2,
"update_at": null,
"version": 1
},
"msg": ""
}
修改单个CC规则组
put:/v1/cc-rules/<规则组ID>
string:name#规则组名称
integer:sort=100#排序
des#备注
json:data#数据类型为数组,数组元素格式为{"action":"ipset","matcher":"1","state":true,"filter1":"1","filter2":""}。action可选值为ipset, exit, log,matcher为匹配器id,filter1和filter2为过滤器id,state为状态,表示是否启用
boolean:enable#禁用或启用,默认为启用
boolean:is_show#是否显示,默认为显示
<<<
返回结果
{
"code":0,
"data": "",
"msg": "更新cc规则成功"
}
<<<
提交内容
{
"name": "新名称",
}
删除CC规则组
delete:/v1/cc-rules/<规则组ID,多个以逗号分隔>
<<<
返回结果
{
"code": 0,
"data": "",
"msg": "cc规则删除成功"
}