1、动态规则:新增批量审核、统计接口。修改query动态规则不查询auditstatus
2、静态规则:新增批量审核、统计接口。 3、任务:新增批量审核、统计接口。 4、白名单:新增统计接口、 5、防护对象:新增统计接口 6、策略模板:新增统计接口
This commit is contained in:
@@ -2,6 +2,7 @@ package com.realtime.protection.server.rule.dynamicrule;
|
||||
|
||||
import com.realtime.protection.configuration.entity.rule.dynamicrule.DynamicRuleObject;
|
||||
import com.realtime.protection.configuration.response.ResponseResult;
|
||||
import com.realtime.protection.configuration.utils.enums.audit.AuditStatusEnum;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -164,15 +165,22 @@ public class DynamicRuleController implements DynamicRuleControllerApi {
|
||||
/**
|
||||
* 获取统计数据
|
||||
*/
|
||||
@Override
|
||||
@GetMapping("/statistics")
|
||||
public ResponseResult getStaticRuleStatisticsData(){
|
||||
|
||||
return ResponseResult.ok()
|
||||
.setData("dynamic_rule_num", dynamicRuleService.queryDynamicRuleTotalNum(null, null,
|
||||
null, null))
|
||||
.setData("dynamic_rule_used_num", dynamicRuleService.queryUsedDynamicRuleTotalNum())
|
||||
.setData("dynamic_rule_audit_num", dynamicRuleService.queryAuditDynamicRuleTotalNum(1))
|
||||
.setData("dynamic_rule_unaudit_num", dynamicRuleService.queryAuditDynamicRuleTotalNum(0));
|
||||
.setData("dynamic_rule_used_num", dynamicRuleService.queryAuditDynamicRuleTotalNum(
|
||||
AuditStatusEnum.getNumByState(AuditStatusEnum.USING.getState())
|
||||
))
|
||||
.setData("dynamic_rule_audit_num", dynamicRuleService.queryAuditDynamicRuleTotalNum(
|
||||
AuditStatusEnum.getNumByState(AuditStatusEnum.AUDITED.getState())
|
||||
))
|
||||
.setData("dynamic_rule_unaudit_num", dynamicRuleService.queryAuditDynamicRuleTotalNum(
|
||||
AuditStatusEnum.getNumByState(AuditStatusEnum.PENDING.getState())
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -358,5 +358,37 @@ public interface DynamicRuleControllerApi {
|
||||
@RequestParam(value = "page", defaultValue = "1") Integer page,
|
||||
@RequestParam(value = "page_size", defaultValue = "10") Integer pageSize);
|
||||
|
||||
@Operation(
|
||||
summary = "数据统计",
|
||||
description = "数据统计",
|
||||
responses = {
|
||||
@ApiResponse(
|
||||
description = "返回数据统计",
|
||||
content = @Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = ResponseResult.class),
|
||||
examples = @ExampleObject(
|
||||
name = "example",
|
||||
value = """
|
||||
{
|
||||
"code": 200,
|
||||
"message": "request succeed",
|
||||
"data": {
|
||||
"dynamic_rule_num": 3,
|
||||
"dynamic_rule_used_num": 0,
|
||||
"dynamic_rule_audit_num": 2,
|
||||
"dynamic_rule_unaudit_num": 0
|
||||
}
|
||||
}
|
||||
"""
|
||||
)
|
||||
)
|
||||
)
|
||||
},
|
||||
parameters = {
|
||||
|
||||
}
|
||||
)
|
||||
@GetMapping("/statistics")
|
||||
ResponseResult getStaticRuleStatisticsData();
|
||||
}
|
||||
Reference in New Issue
Block a user