1、任务、规则、配置添加更新查询审核意见接口

(cherry picked from commit 826e0249cc)
This commit is contained in:
PushM
2024-05-09 18:25:49 +08:00
parent 6075388ee8
commit 8cc0af06a1
31 changed files with 715 additions and 4 deletions

View File

@@ -195,4 +195,23 @@ public class ProtectObjectController implements ProtectObjectControllerApi {
return ResponseResult.ok()
.setData("success", protectObjectService.updateAuditStatusBatch(idsWithAuditStatusMap));
}
@Override
@PostMapping("/auditInfo/{ids}")
public ResponseResult updateAuditInfo(@PathVariable List<Integer> ids,
@RequestBody Map<String, String> auditInfo) {
if (auditInfo.get("auditInfo") == null || auditInfo.get("auditInfo").isEmpty()) {
throw new IllegalArgumentException("auditInfo is empty");
}
return ResponseResult.ok()
.setData("success", protectObjectService.updateAuditInfo(ids, auditInfo.get("auditInfo")));
}
@Override
@GetMapping("/auditInfo/{id}")
public ResponseResult queryAuditInfo(@PathVariable Integer id) {
return ResponseResult.ok()
.setData("auditInfo", protectObjectService.queryAuditInfo(id));
}
}

View File

@@ -447,6 +447,83 @@ public interface ProtectObjectControllerApi {
@GetMapping("/statistics")
ResponseResult statisticsProtectObject();
@Operation(
summary = "批量更新审批状态",
description = "批量更新审批状态0未审核、1审核不通过、2审核通过",
responses = {
@io.swagger.v3.oas.annotations.responses.ApiResponse(
description = "返回审核结果",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = ResponseResult.class)
)
)
},
requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(
description = "字典key是idvalue是审核状态",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = Map.class)
)
)
)
@PostMapping("/auditbatch")
ResponseResult updateWhiteListAuditStatusBatch(@RequestBody Map<Integer, Integer> idsWithAuditStatusMap);
@Operation(
summary = "更新审批意见",
description = "批量更新审批意见接收多个id",
responses = {
@io.swagger.v3.oas.annotations.responses.ApiResponse(
description = "返回是否成功",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = ResponseResult.class)
)
)
},
requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(
description = "字典key是'audit_info'value是审核意见",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = Map.class),
examples = @ExampleObject(
name = "example",
value = """
{
"audit_info": "审核不通过原因是xxxx"
}
"""
)
)
),
parameters = {
@Parameter(name = "ids", description = "欲更新的ID", example = "2,3"),
}
)
@PostMapping("/auditInfo/{ids}")
ResponseResult updateAuditInfo(@PathVariable List<Integer> ids,
@RequestBody Map<String, String> auditInfo);
@Operation(
summary = "查询审批意见",
description = "查询审批意见只接收一个id",
responses = {
@io.swagger.v3.oas.annotations.responses.ApiResponse(
description = "返回是否成功",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = ResponseResult.class)
)
)
},
parameters = {
@Parameter(name = "id", description = "查询的ID", example = "2"),
}
)
@GetMapping("/auditInfo/{id}")
ResponseResult queryAuditInfo(@PathVariable Integer id);
}

View File

@@ -56,4 +56,8 @@ public interface ProtectObjectMapper {
void updateAuditStatusByIdBatch(@Param("idWithAuditStatusBatch") Map<Integer, Integer> idWithAuditStatusBatch);
List<Integer> queryAuditStatusByIds(@Param("idsWithAuditStatusMap") Map<Integer, Integer> idsWithAuditStatusMap);
Boolean updateAuditInfo(@Param("ids")List<Integer> ids, @Param("auditInfo")String auditInfo);
String queryProtectObjectAuditInfo(Integer id);
}

View File

@@ -215,4 +215,12 @@ public class ProtectObjectService {
return sqlSessionWrapper.startBatchSession(ProtectObjectMapper.class, updateProtectObjectAuditStatusFunction, idsWithAuditStatusMap);
}
public Boolean updateAuditInfo(List<Integer> ids, String auditInfo) {
return protectObjectMapper.updateAuditInfo(ids, auditInfo);
}
public String queryAuditInfo(Integer id) {
return protectObjectMapper.queryProtectObjectAuditInfo(id);
}
}

View File

@@ -173,4 +173,23 @@ public class TemplateController implements TemplateControllerApi {
return ResponseResult.ok()
.setData("success", templateService.updateAuditStatusBatch(idsWithAuditStatusMap));
}
@Override
@PostMapping("/auditInfo/{ids}")
public ResponseResult updateAuditInfo(@PathVariable List<Integer> ids,
@RequestBody Map<String, String> auditInfo) {
if (auditInfo.get("auditInfo") == null || auditInfo.get("auditInfo").isEmpty()) {
throw new IllegalArgumentException("auditInfo is empty");
}
return ResponseResult.ok()
.setData("success", templateService.updateAuditInfo(ids, auditInfo.get("auditInfo")));
}
@Override
@GetMapping("/auditInfo/{id}")
public ResponseResult queryAuditInfo(@PathVariable Integer id) {
return ResponseResult.ok()
.setData("auditInfo", templateService.queryAuditInfo(id));
}
}

View File

@@ -13,6 +13,7 @@ import jakarta.validation.Valid;
import jakarta.validation.constraints.Min;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@Tag(name = "防御策略模板API", description = "防御策略模板模块所有接口")
@@ -481,6 +482,83 @@ public interface TemplateControllerApi {
@GetMapping("/statistics")
ResponseResult statisticsTemplate();
@Operation(
summary = "批量更新审批状态",
description = "批量更新审批状态0未审核、1审核不通过、2审核通过",
responses = {
@io.swagger.v3.oas.annotations.responses.ApiResponse(
description = "返回审核结果",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = ResponseResult.class)
)
)
},
requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(
description = "字典key是idvalue是审核状态",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = Map.class)
)
)
)
@PostMapping("/auditbatch")
ResponseResult updateWhiteListAuditStatusBatch(@RequestBody Map<Integer, Integer> idsWithAuditStatusMap);
@Operation(
summary = "更新审批意见",
description = "批量更新审批意见接收多个id",
responses = {
@io.swagger.v3.oas.annotations.responses.ApiResponse(
description = "返回是否成功",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = ResponseResult.class)
)
)
},
requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(
description = "字典key是'audit_info'value是审核意见",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = Map.class),
examples = @ExampleObject(
name = "example",
value = """
{
"audit_info": "审核不通过原因是xxxx"
}
"""
)
)
),
parameters = {
@Parameter(name = "ids", description = "欲更新的ID", example = "2,3"),
}
)
@PostMapping("/auditInfo/{ids}")
ResponseResult updateAuditInfo(@PathVariable List<Integer> ids,
@RequestBody Map<String, String> auditInfo);
@Operation(
summary = "查询审批意见",
description = "查询审批意见只接收一个id",
responses = {
@io.swagger.v3.oas.annotations.responses.ApiResponse(
description = "返回是否成功",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = ResponseResult.class)
)
)
},
parameters = {
@Parameter(name = "id", description = "查询的ID", example = "2"),
}
)
@GetMapping("/auditInfo/{id}")
ResponseResult queryAuditInfo(@PathVariable Integer id);
}

View File

@@ -53,4 +53,8 @@ public interface TemplateMapper {
List<Integer> queryAuditStatusByIds(@Param("idsWithAuditStatusMap") Map<Integer, Integer> idsWithAuditStatusMap);
void updateAuditStatusByIdBatch(@Param("idWithAuditStatusBatch") Map<Integer, Integer> idWithAuditStatusBatch);
Boolean updateAuditInfo(List<Integer> ids, String auditInfo);
String queryAuditInfo(Integer id);
}

View File

@@ -174,4 +174,11 @@ public class TemplateService {
}
public Boolean updateAuditInfo(List<Integer> ids, String auditInfo) {
return templateMapper.updateAuditInfo(ids, auditInfo);
}
public String queryAuditInfo(Integer id) {
return templateMapper.queryAuditInfo(id);
}
}

View File

@@ -131,6 +131,7 @@ public class DynamicRuleController implements DynamicRuleControllerApi {
/**
* 审批
*/
@Override
@GetMapping("/{id}/audit/{auditStatus}")
public ResponseResult updateDynamicRuleAuditStatus(@PathVariable Integer id, @PathVariable Integer auditStatus) {
if (id <= 0 || auditStatus < 0 || auditStatus > 2) {
@@ -146,6 +147,7 @@ public class DynamicRuleController implements DynamicRuleControllerApi {
/**
* 批量审批
*/
@Override
@PostMapping("/auditbatch")
public ResponseResult updateDynamicRuleAuditStatusBatch(@RequestBody Map<Integer, Integer> idsWithAuditStatusMap) {
List<Integer> errorIds = new ArrayList<>();
@@ -187,6 +189,22 @@ public class DynamicRuleController implements DynamicRuleControllerApi {
AuditStatusEnum.getNumByState(AuditStatusEnum.PENDING.getState())
));
}
@Override
@PostMapping("/auditInfo/{ids}")
public ResponseResult updateAuditInfo(@PathVariable List<Integer> ids,
@RequestBody Map<String, String> auditInfo) {
if (auditInfo.get("auditInfo") == null || auditInfo.get("auditInfo").isEmpty()) {
throw new IllegalArgumentException("auditInfo is empty");
}
return ResponseResult.ok()
.setData("success", dynamicRuleService.updateAuditInfo(ids, auditInfo.get("auditInfo")));
}
@Override
@GetMapping("/auditInfo/{id}")
public ResponseResult queryAuditInfo(@PathVariable Integer id) {
return ResponseResult.ok()
.setData("auditInfo", dynamicRuleService.queryAuditInfo(id));
}
}

View File

@@ -10,12 +10,10 @@ import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@Tag(name = "动态规则API", description = "动态规则模块所有接口")
public interface DynamicRuleControllerApi {
@@ -365,6 +363,47 @@ public interface DynamicRuleControllerApi {
@RequestParam(value = "template_name", required = false) String templateName,
@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "page_size", defaultValue = "10") Integer pageSize);
@Operation(
summary = "更新批状态",
description = "更新审批状态0未审核、1审核不通过、2审核通过",
responses = {
@io.swagger.v3.oas.annotations.responses.ApiResponse(
description = "返回审核结果",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = ResponseResult.class)
)
)
},
parameters = {
@Parameter(name = "id", description = "id"),
@Parameter(name = "auditStatus", description = "要修改为的审核状态")
}
)
ResponseResult updateDynamicRuleAuditStatus(@PathVariable Integer id, @PathVariable Integer auditStatus);
@Operation(
summary = "批量更新审批状态",
description = "批量更新审批状态0未审核、1审核不通过、2审核通过",
responses = {
@io.swagger.v3.oas.annotations.responses.ApiResponse(
description = "返回审核结果",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = ResponseResult.class)
)
)
},
requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(
description = "字典key是idvalue是审核状态",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = Map.class)
)
)
)
ResponseResult updateDynamicRuleAuditStatusBatch(@RequestBody Map<Integer, Integer> idsWithAuditStatusMap);
@Operation(
summary = "数据统计",
@@ -399,4 +438,60 @@ public interface DynamicRuleControllerApi {
)
@GetMapping("/statistics")
ResponseResult getStaticRuleStatisticsData();
@Operation(
summary = "更新审批意见",
description = "批量更新审批意见接收多个id",
responses = {
@io.swagger.v3.oas.annotations.responses.ApiResponse(
description = "返回是否成功",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = ResponseResult.class)
)
)
},
requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(
description = "字典key是'audit_info'value是审核意见",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = Map.class),
examples = @ExampleObject(
name = "example",
value = """
{
"audit_info": "审核不通过原因是xxxx"
}
"""
)
)
),
parameters = {
@Parameter(name = "ids", description = "欲更新的ID", example = "2,3"),
}
)
@PostMapping("/auditInfo/{ids}")
ResponseResult updateAuditInfo(@PathVariable List<Integer> ids,
@RequestBody Map<String, String> auditInfo);
@Operation(
summary = "查询审批意见",
description = "查询审批意见只接收一个id",
responses = {
@io.swagger.v3.oas.annotations.responses.ApiResponse(
description = "返回是否成功",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = ResponseResult.class)
)
)
},
parameters = {
@Parameter(name = "id", description = "查询的ID", example = "2"),
}
)
@GetMapping("/auditInfo/{id}")
ResponseResult queryAuditInfo(@PathVariable Integer id);
}

View File

@@ -62,4 +62,8 @@ public interface DynamicRuleMapper {
void updateAuditStatusByIdBatch(@Param("idWithAuditStatusBatch") Map<Integer, Integer> idWithAuditStatusBatch);
List<Integer> queryAuditStatusByIds(@Param("idWithAuditStatusMap") Map<Integer, Integer> idWithAuditStatusMap);
Boolean updateAuditInfo(@Param("ids")List<Integer> ids, @Param("auditInfo")String auditInfo);
String queryAuditInfo(Integer id);
}

View File

@@ -282,4 +282,12 @@ public class DynamicRuleService {
public List<Integer> queryAuditStatusByIds(Map<Integer, Integer> idsWithAuditStatusMap) {
return dynamicRuleMapper.queryAuditStatusByIds(idsWithAuditStatusMap);
}
public Boolean updateAuditInfo(List<Integer> ids, String auditInfo) {
return dynamicRuleMapper.updateAuditInfo(ids, auditInfo);
}
public String queryAuditInfo(Integer id) {
return dynamicRuleMapper.queryAuditInfo(id);
}
}

View File

@@ -224,6 +224,22 @@ public class StaticRuleController implements StaticRuleControllerApi {
}
@Override
@PostMapping("/auditInfo/{ids}")
public ResponseResult updateAuditInfo(@PathVariable List<Integer> ids,
@RequestBody Map<String, String> auditInfo) {
if (auditInfo.get("auditInfo") == null || auditInfo.get("auditInfo").isEmpty()) {
throw new IllegalArgumentException("auditInfo is empty");
}
return ResponseResult.ok()
.setData("success", staticRuleService.updateAuditInfo(ids, auditInfo.get("auditInfo")));
}
@Override
@GetMapping("/auditInfo/{id}")
public ResponseResult queryAuditInfo(@PathVariable Integer id) {
return ResponseResult.ok()
.setData("auditInfo", staticRuleService.queryAuditInfo(id));
}
}

View File

@@ -346,4 +346,60 @@ public interface StaticRuleControllerApi {
)
@GetMapping("/statistics")
ResponseResult getStaticRuleStatisticsData();
@Operation(
summary = "更新审批意见",
description = "批量更新审批意见接收多个id",
responses = {
@io.swagger.v3.oas.annotations.responses.ApiResponse(
description = "返回是否成功",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = ResponseResult.class)
)
)
},
requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(
description = "字典key是'audit_info'value是审核意见",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = Map.class),
examples = @ExampleObject(
name = "example",
value = """
{
"audit_info": "审核不通过原因是xxxx"
}
"""
)
)
),
parameters = {
@Parameter(name = "ids", description = "欲更新的ID", example = "2,3"),
}
)
@PostMapping("/auditInfo/{ids}")
ResponseResult updateAuditInfo(@PathVariable List<Integer> ids,
@RequestBody Map<String, String> auditInfo);
@Operation(
summary = "查询审批意见",
description = "查询审批意见只接收一个id",
responses = {
@io.swagger.v3.oas.annotations.responses.ApiResponse(
description = "返回是否成功",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = ResponseResult.class)
)
)
},
parameters = {
@Parameter(name = "id", description = "查询的ID", example = "2"),
}
)
@GetMapping("/auditInfo/{id}")
ResponseResult queryAuditInfo(@PathVariable Integer id);
}

View File

@@ -57,4 +57,8 @@ public interface StaticRuleMapper {
Integer queryAuditStaticRuleTotalNum(@Param("auditStatus")Integer auditStatus);
List<Integer> queryAuditStatusByIds(@Param("idWithAuditStatusBatch") Map<Integer, Integer> idsWithAuditStatusMap);
Boolean updateAuditInfo(@Param("ids") List<Integer> ids, @Param("auditInfo") String auditInfo);
String queryAuditInfo(Integer id);
}

View File

@@ -324,4 +324,12 @@ public class StaticRuleService {
public Integer queryAuditStaticRuleTotalNum(Integer auditStatus) {
return staticRuleMapper.queryAuditStaticRuleTotalNum(auditStatus);
}
public Boolean updateAuditInfo(List<Integer> ids, String auditInfo) {
return staticRuleMapper.updateAuditInfo(ids, auditInfo);
}
public String queryAuditInfo(Integer id) {
return staticRuleMapper.queryAuditInfo(id);
}
}

View File

@@ -209,4 +209,23 @@ public class TaskController implements TaskControllerApi {
));
}
@Override
@PostMapping("/auditInfo/{ids}")
public ResponseResult updateAuditInfo(@PathVariable List<Integer> ids,
@RequestBody Map<String, String> auditInfo) {
if (auditInfo.get("auditInfo") == null || auditInfo.get("auditInfo").isEmpty()) {
throw new IllegalArgumentException("auditInfo is empty");
}
return ResponseResult.ok()
.setData("success", taskService.updateAuditInfo(ids, auditInfo.get("auditInfo")));
}
@Override
@GetMapping("/auditInfo/{id}")
public ResponseResult queryAuditInfo(@PathVariable Integer id) {
return ResponseResult.ok()
.setData("auditInfo", taskService.queryAuditInfo(id));
}
}

View File

@@ -17,6 +17,7 @@ import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@Tag(name = "任务控制器API", description = "任务管理模块相关的所有接口")
@@ -598,4 +599,60 @@ public interface TaskControllerApi {
)
@GetMapping("/statistics")
ResponseResult statistics();
@Operation(
summary = "更新审批意见",
description = "批量更新审批意见接收多个id",
responses = {
@io.swagger.v3.oas.annotations.responses.ApiResponse(
description = "返回是否成功",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = ResponseResult.class)
)
)
},
requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(
description = "字典key是'audit_info'value是审核意见",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = Map.class),
examples = @ExampleObject(
name = "example",
value = """
{
"audit_info": "审核不通过原因是xxxx"
}
"""
)
)
),
parameters = {
@Parameter(name = "ids", description = "欲更新的ID", example = "2,3"),
}
)
@PostMapping("/auditInfo/{ids}")
ResponseResult updateAuditInfo(@PathVariable List<Integer> ids,
@RequestBody Map<String, String> auditInfo);
@Operation(
summary = "查询审批意见",
description = "查询审批意见只接收一个id",
responses = {
@io.swagger.v3.oas.annotations.responses.ApiResponse(
description = "返回是否成功",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = ResponseResult.class)
)
)
},
parameters = {
@Parameter(name = "id", description = "查询的ID", example = "2"),
}
)
@GetMapping("/auditInfo/{id}")
ResponseResult queryAuditInfo(@PathVariable Integer id);
}

View File

@@ -74,4 +74,8 @@ public interface TaskMapper {
Integer queryAuditTaskTotalNum(Integer auditState);
List<Integer> queryAuditStatusByIds(@Param("idWithAuditStatusBatch") Map<Integer, Integer> idsWithAuditStatusMap);
Boolean updateAuditInfo(@Param("ids")List<Integer> ids, @Param("auditInfo")String auditInfo);
String queryAuditInfo(Integer id);
}

View File

@@ -404,4 +404,11 @@ public class TaskService {
return taskMapper.queryAuditStatusByIds(idsWithAuditStatusMap);
}
public Boolean updateAuditInfo(List<Integer> ids, String auditInfo) {
return taskMapper.updateAuditInfo(ids, auditInfo);
}
public String queryAuditInfo(Integer id) {
return taskMapper.queryAuditInfo(id);
}
}

View File

@@ -239,5 +239,23 @@ public class WhiteListController implements WhiteListControllerApi {
.setData("success", whiteListService.updateAuditStatusBatch(idsWithAuditStatusMap));
}
@Override
@PostMapping("/auditInfo/{ids}")
public ResponseResult updateAuditInfo(@PathVariable List<Integer> ids,
@RequestBody Map<String, String> auditInfo) {
if (auditInfo.get("auditInfo") == null || auditInfo.get("auditInfo").isEmpty()) {
throw new IllegalArgumentException("auditInfo is empty");
}
return ResponseResult.ok()
.setData("success", whiteListService.updateAuditInfo(ids, auditInfo.get("auditInfo")));
}
@Override
@GetMapping("/auditInfo/{id}")
public ResponseResult queryAuditInfo(@PathVariable Integer id) {
return ResponseResult.ok()
.setData("auditInfo", whiteListService.queryAuditInfo(id));
}
}

View File

@@ -296,6 +296,84 @@ public interface WhiteListControllerApi {
@GetMapping("/statistics")
ResponseResult getWhiteListStatisticsData();
@Operation(
summary = "批量更新审批状态",
description = "批量更新审批状态0未审核、1审核不通过、2审核通过",
responses = {
@io.swagger.v3.oas.annotations.responses.ApiResponse(
description = "返回审核结果",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = ResponseResult.class)
)
)
},
requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(
description = "字典key是idvalue是审核状态",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = Map.class)
)
)
)
@PostMapping("/auditbatch")
ResponseResult updateWhiteListAuditStatusBatch(@RequestBody Map<Integer, Integer> idsWithAuditStatusMap);
@Operation(
summary = "更新审批意见",
description = "批量更新审批意见接收多个id",
responses = {
@io.swagger.v3.oas.annotations.responses.ApiResponse(
description = "返回是否成功",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = ResponseResult.class)
)
)
},
requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(
description = "字典key是'audit_info'value是审核意见",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = Map.class),
examples = @ExampleObject(
name = "example",
value = """
{
"audit_info": "审核不通过原因是xxxx"
}
"""
)
)
),
parameters = {
@Parameter(name = "ids", description = "欲更新的ID", example = "2,3"),
}
)
@PostMapping("/auditInfo/{ids}")
ResponseResult updateAuditInfo(@PathVariable List<Integer> ids,
@RequestBody Map<String, String> auditInfo);
@Operation(
summary = "查询审批意见",
description = "查询审批意见只接收一个id",
responses = {
@io.swagger.v3.oas.annotations.responses.ApiResponse(
description = "返回是否成功",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = ResponseResult.class)
)
)
},
parameters = {
@Parameter(name = "id", description = "查询的ID", example = "2"),
}
)
@GetMapping("/auditInfo/{id}")
ResponseResult queryAuditInfo(@PathVariable Integer id);
}

View File

@@ -55,4 +55,8 @@ public interface WhiteListMapper {
void updateAuditStatusByIdBatch(@Param("idsWithAuditStatusMap") Map<Integer, Integer> idsWithAuditStatusMap);
List<Integer> queryAuditStatusByIds(@Param("idsWithAuditStatusMap") Map<Integer, Integer> idsWithAuditStatusMap);
Boolean updateAuditInfo(@Param("ids")List<Integer> ids, @Param("auditInfo")String auditInfo);
String queryWhiteListObjectAuditInfo(Integer id);
}

View File

@@ -264,4 +264,12 @@ public class WhiteListService {
return sqlSessionWrapper.startBatchSession(WhiteListMapper.class, updateWhiteListAuditStatusFunction, idsWithAuditStatusMap);
}
public Boolean updateAuditInfo(List<Integer> ids, String auditInfo) {
return whiteListMapper.updateAuditInfo(ids, auditInfo);
}
public String queryAuditInfo(Integer id) {
return whiteListMapper.queryWhiteListObjectAuditInfo(id);
}
}

View File

@@ -120,6 +120,14 @@
#{id}
</foreach>
</update>
<update id="updateAuditInfo">
UPDATE t_dynamic_rule
SET dynamic_rule_audit_info = #{auditInfo}
WHERE dynamic_rule_id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<resultMap id="dynamicRuleMap"
@@ -311,6 +319,11 @@
#{id}
</foreach>
</select>
<select id="queryAuditInfo" resultType="java.lang.String">
select dynamic_rule_audit_info
from t_dynamic_rule
where dynamic_rule_id = #{dynamicRuleId}
</select>
</mapper>

View File

@@ -149,6 +149,11 @@
#{id}
</foreach>
</select>
<select id="queryProtectObjectAuditInfo" resultType="java.lang.String">
SELECT protect_object_audit_info
FROM t_protect_object
WHERE protect_object_id = #{proobj_id}
</select>
<update id="updateProtectObject">
UPDATE t_protect_object
@@ -201,4 +206,13 @@
#{id}
</foreach>
</update>
<update id="updateAuditInfo">
UPDATE t_protect_object
SET protect_object_audit_info = #{auditInfo}
WHERE protect_object_id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

View File

@@ -101,6 +101,16 @@
</foreach>
</update>
<update id="updateAuditInfo">
UPDATE t_static_rule
SET static_rule_audit_info = #{auditInfo}
WHERE static_rule_id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<delete id="deleteStaticRules">
delete from t_static_rule
where static_rule_id in
@@ -270,5 +280,10 @@
#{id}
</foreach>
</select>
<select id="queryAuditInfo" resultType="java.lang.String">
SELECT static_rule_audit_info
FROM t_static_rule
WHERE static_rule_id = #{id}
</select>
</mapper>

View File

@@ -210,6 +210,14 @@
#{id}
</foreach>
</update>
<update id="updateAuditInfo">
UPDATE t_task
SET task_audit_info = #{auditInfo}
WHERE task_id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<delete id="deleteTask">
DELETE
@@ -389,4 +397,9 @@
#{taskId}
</foreach>
</select>
<select id="queryAuditInfo" resultType="java.lang.String">
SELECT task_audit_info
FROM t_task
WHERE task_id = #{taskId}
</select>
</mapper>

View File

@@ -180,6 +180,11 @@
#{id}
</foreach>
</select>
<select id="queryAuditInfo" resultType="java.lang.String">
SELECT audit_info
FROM t_strategy_template
WHERE strategy_template_id = #{id}
</select>
<update id="updateTemplateInformation">
UPDATE t_strategy_template
@@ -211,4 +216,12 @@
#{id}
</foreach>
</update>
<update id="updateAuditInfo">
UPDATE t_strategy_template
SET audit_info = #{auditInfo}
WHERE strategy_template_id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

View File

@@ -130,6 +130,14 @@
#{id}
</foreach>
</update>
<update id="updateAuditInfo">
UPDATE t_white_list
SET white_list_audit_info = #{auditInfo}
WHERE white_list_id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<select id="existWhiteListObject" resultType="java.lang.String">
select CONCAT(INET_NTOA(white_list_ip)," ", CAST(white_list_port)," ", white_list_url)
@@ -335,5 +343,10 @@
#{id}
</foreach>
</select>
<select id="queryWhiteListObjectAuditInfo" resultType="java.lang.String">
select white_list_audit_info
from t_white_list
where white_list_id = #{id}
</select>
</mapper>

View File

@@ -166,4 +166,14 @@ class ProtectObjectServiceTest extends ProtectionApplicationTests {
int finalTestNum = testNum;
assertThrows(IllegalArgumentException.class, () -> protectObjectService.changeProtectObjectAuditStatus(finalTestNum, 2));
}
@Test
void updateAuditInfo() {
List<ProtectObject> protectObjectList = protectObjectService.queryProtectObjects(null, null, null, null, null, null, null, null, null, null, 1, 1);
List<Integer> idList = new ArrayList<>();
idList.add(protectObjectList.get(0).getProtectObjectId());
System.out.println(idList);
assertTrue(protectObjectService.updateAuditInfo( idList, "test"));
assertEquals("test", protectObjectService.queryAuditInfo(idList.get(0)));
}
}