Merge remote-tracking branch 'origin/master'
# Conflicts: # src/main/java/com/realtime/protection/server/rule/dynamicrule/DynamicRuleControllerApi.java # src/main/java/com/realtime/protection/server/rule/dynamicrule/DynamicRuleService.java # src/main/java/com/realtime/protection/server/rule/staticrule/StaticRuleControllerApi.java # src/main/resources/mappers/StaticRuleMapper.xml # src/test/java/com/realtime/protection/server/rule/dynamic/DynamicRuleServiceTest.java # src/test/java/com/realtime/protection/server/rule/staticrule/StaticRuleServiceTest.java
This commit is contained in:
@@ -18,7 +18,7 @@ public class ProtectObject {
|
||||
private Integer protectObjectId;
|
||||
|
||||
@JsonProperty("proobj_name")
|
||||
@NotNull(message = "proobj_name should not be empty.")
|
||||
@NotNull(message = "proobj_name字段不能为空。")
|
||||
@ExcelProperty("名称")
|
||||
@Schema(description = "防护对象名称", example = "静态对象测试")
|
||||
private String protectObjectName;
|
||||
@@ -35,21 +35,21 @@ public class ProtectObject {
|
||||
private String protectObjectIPAddress;
|
||||
|
||||
@JsonProperty("proobj_port")
|
||||
@NotNull(message = "proobj_port should not be empty.")
|
||||
@Max(value = 65535, message = "port should not be more than 65535")
|
||||
@Min(value = 1, message = "port should not be less than 1")
|
||||
@NotNull(message = "proobj_port字段不能为空。")
|
||||
@Max(value = 65535, message = "端口号不能大于65535。")
|
||||
@Min(value = 1, message = "端口号不能小于1。")
|
||||
@ExcelProperty("端口")
|
||||
@Schema(description = "防护对象端口", maximum = "65535", minimum = "1", example = "8080")
|
||||
private Integer protectObjectPort;
|
||||
|
||||
@JsonProperty("proobj_url")
|
||||
@NotNull(message = "proobj_url should not be empty.")
|
||||
@NotNull(message = "proobj_url字段不能为空。")
|
||||
@ExcelProperty("URL")
|
||||
@Schema(description = "防护对象URL", example = "alice.bob.com")
|
||||
private String protectObjectURL;
|
||||
|
||||
@JsonProperty("proobj_protocol")
|
||||
@NotNull(message = "proobj_protocol should not be empty.")
|
||||
@NotNull(message = "proobj_protocol字段不能为空")
|
||||
@ExcelProperty("协议")
|
||||
@Schema(description = "防护对象网络协议(目前仅可以填写TCP或UDP)", example = "TCP")
|
||||
private String protectObjectProtocol;
|
||||
|
||||
@@ -12,27 +12,27 @@ public class Template {
|
||||
private Integer templateId;
|
||||
|
||||
@JsonProperty("template_name")
|
||||
@NotNull(message = "template name should not be empty.")
|
||||
@NotNull(message = "template_name字段不能为空。")
|
||||
@Schema(description = "防御策略模板名称", example = "自定义模板")
|
||||
private String templateName;
|
||||
|
||||
@JsonProperty("source_system")
|
||||
@NotNull(message = "source_system should not be empty. ")
|
||||
@NotNull(message = "source_system字段不能为空。")
|
||||
@Schema(description = "防御策略模板数据来源系统", example = "BW系统")
|
||||
private String sourceSystem;
|
||||
|
||||
@JsonProperty("protect_level_low")
|
||||
@NotNull(message = "protect_level_low should not be empty. ")
|
||||
@NotNull(message = "protect_level_low字段不能为空。")
|
||||
@Schema(description = "防御策略模板日常态字段提取选项")
|
||||
private ProtectLevel protectLevelLow;
|
||||
|
||||
@JsonProperty("protect_level_medium")
|
||||
@NotNull(message = "protect_level_medium should not be empty. ")
|
||||
@NotNull(message = "protect_level_medium字段不能为空。")
|
||||
@Schema(description = "防御策略模板应急态字段提取选项")
|
||||
private ProtectLevel protectLevelMedium;
|
||||
|
||||
@JsonProperty("protect_level_high")
|
||||
@NotNull(message = "protect_level_high should not be empty. ")
|
||||
@NotNull(message = "protect_level_high字段不能为空。")
|
||||
@Schema(description = "防御策略模板紧急态字段提取选项")
|
||||
private ProtectLevel protectLevelHigh;
|
||||
|
||||
|
||||
@@ -17,19 +17,19 @@ public class Task {
|
||||
private Long taskId;
|
||||
|
||||
@JsonProperty("task_name")
|
||||
@NotNull(message = "task_name should not be empty. ")
|
||||
@NotNull(message = "task_name字段不能为空。")
|
||||
@Schema(description = "任务名称", example = "静态任务")
|
||||
private String taskName;
|
||||
|
||||
@JsonProperty("task_start_time")
|
||||
@NotNull(message = "task_start_time should not be empty. ")
|
||||
@Future(message = "task_start_time should be a future time")
|
||||
@NotNull(message = "task_start_time字段不能为空。")
|
||||
@Future(message = "task_start_time必须晚于当前时间。")
|
||||
@Schema(description = "任务开始时间,必须晚于当前时间", example = "2024-10-23T00:00:00")
|
||||
private LocalDateTime taskStartTime;
|
||||
|
||||
@JsonProperty("task_end_time")
|
||||
@NotNull(message = "task_end_time should not be empty. ")
|
||||
@Future(message = "task_end_time should be a future time. ")
|
||||
@NotNull(message = "task_end_time字段不能为空。")
|
||||
@Future(message = "task_end_time必须晚于当前时间。")
|
||||
@Schema(description = "任务结束时间,必须晚于开始时间", example = "2024-10-24T00:00:00")
|
||||
private LocalDateTime taskEndTime;
|
||||
|
||||
@@ -42,12 +42,12 @@ public class Task {
|
||||
private LocalDateTime taskModifyTime;
|
||||
|
||||
@JsonProperty("task_type")
|
||||
@NotNull(message = "task_type should not be empty. ")
|
||||
@NotNull(message = "task_type字段不能为空。")
|
||||
@Schema(description = "任务类型,1为静态任务,2为实时任务,3为研判后任务", example = "1")
|
||||
private Integer taskType;
|
||||
|
||||
@JsonProperty("task_act")
|
||||
@NotNull(message = "task_act should not be empty. ")
|
||||
@NotNull(message = "task_act字段不能为空。")
|
||||
@Schema(description = "任务行为,目前只能为【阻断】", example = "阻断")
|
||||
private String taskAct;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public class WhiteListObject {
|
||||
@JsonProperty("whiteobj_ip_address")
|
||||
@Pattern(regexp = "^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$", message = "Invalid IPv4 Address")
|
||||
@ExcelProperty("IP地址")
|
||||
@Schema(description = "白名单对象IPv4地址", example = "1.1.1.1" , requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Schema(description = "白名单对象IPv4地址", example = "1.1.1.1", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String whiteListIP;
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -30,30 +30,23 @@ public class GlobalExceptionHandler {
|
||||
@Order(3)
|
||||
@ExceptionHandler(value = {Exception.class})
|
||||
public ResponseResult handleGlobalException(Exception e) {
|
||||
log.error("meets global exception: " + e.getMessage());
|
||||
log.error("遭遇全局异常:" + e.getMessage());
|
||||
return ResponseResult.error().setMessage(e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
@Order(2)
|
||||
@ExceptionHandler(value = {PersistenceException.class})
|
||||
public ResponseResult handleSQLException(PersistenceException e) {
|
||||
log.error("meets database exception: " + e.getMessage());
|
||||
@ExceptionHandler(value = {PersistenceException.class, DuplicateKeyException.class})
|
||||
public ResponseResult handleSQLException(Exception e) {
|
||||
log.info("遭遇数据库异常:" + e.getMessage());
|
||||
return ResponseResult.invalid().setMessage(
|
||||
"please check the integrity of the data. check if the json data exists in the database");
|
||||
}
|
||||
|
||||
@Order(2)
|
||||
@ExceptionHandler(value = DuplicateKeyException.class)
|
||||
public ResponseResult handleDuplicateKeyException(DuplicateKeyException e) {
|
||||
log.debug("meets duplicate key exception: " + e.getMessage());
|
||||
return ResponseResult.invalid().setMessage("duplicate key in json data");
|
||||
"请检查json字段的完整性,确保json字段按照文档中要求填写。");
|
||||
}
|
||||
|
||||
@Order(2)
|
||||
@ExceptionHandler(value = MethodArgumentNotValidException.class)
|
||||
public ResponseResult handleBindException(MethodArgumentNotValidException e) {
|
||||
log.debug("meets data bind exception: " + e.getMessage());
|
||||
log.debug("遭遇数据绑定异常:" + e.getMessage());
|
||||
return ResponseResult.invalid().setMessage(
|
||||
e.getBindingResult().getAllErrors().stream()
|
||||
.map(DefaultMessageSourceResolvable::getDefaultMessage).collect(Collectors.joining())
|
||||
@@ -67,14 +60,14 @@ public class GlobalExceptionHandler {
|
||||
IllegalStateException.class
|
||||
})
|
||||
public ResponseResult handleHandlerMethodValidationException(Exception e) {
|
||||
log.debug("meets illegal argument exception: " + e.getMessage());
|
||||
log.debug("遭遇非法参数异常:" + e.getMessage());
|
||||
return ResponseResult.invalid().setMessage(e.getMessage());
|
||||
}
|
||||
|
||||
@Order(2)
|
||||
@ExceptionHandler(value = NotLoginException.class)
|
||||
public ResponseResult handleNotLoginException(NotLoginException e) {
|
||||
log.debug("meets not login exception, login type: " + e.getLoginType());
|
||||
log.debug("遭遇Sa-Token登录异常,登录类型为:" + e.getLoginType());
|
||||
return new ResponseResult(
|
||||
401,
|
||||
e.getMessage()
|
||||
@@ -84,16 +77,16 @@ public class GlobalExceptionHandler {
|
||||
@Order(2)
|
||||
@ExceptionHandler(value = SaTokenException.class)
|
||||
public ResponseResult handleSaTokenException(SaTokenException e) {
|
||||
log.debug("sa-token meets exception: " + e.getMessage());
|
||||
log.debug("Sa-token模块遭遇异常:" + e.getMessage());
|
||||
return ResponseResult.unAuthorized().setMessage(e.getMessage());
|
||||
}
|
||||
|
||||
@Order(2)
|
||||
@ExceptionHandler(value = DorisStartException.class)
|
||||
public ResponseResult handleDorisStartException(DorisStartException e) {
|
||||
log.warn("doris database meets exception: " + e.getMessage());
|
||||
log.warn("Doris数据库遭遇异常:" + e.getMessage());
|
||||
ResponseResult responseResult = ResponseResult.error()
|
||||
.setMessage("Doris command creation meets error: " + e.getMessage());
|
||||
.setMessage("Doris数据库指令生成遭遇异常:" + e.getMessage());
|
||||
|
||||
try {
|
||||
stateChangeService.changeState(StateEnum.FAILED.getStateNum(), e.taskId);
|
||||
|
||||
@@ -57,7 +57,7 @@ public class CommandService {
|
||||
commandBatch.clear();
|
||||
}
|
||||
|
||||
log.debug(String.format("create all the commands from task(%d), rule(%d)",
|
||||
log.debug(String.format("在task(%d)和rule(%d)中构建了全部指令",
|
||||
info.getTaskId(), info.getRuleId()));
|
||||
return null;
|
||||
};
|
||||
@@ -68,6 +68,7 @@ public class CommandService {
|
||||
public void createCommand(TaskCommandInfo commandInfo) throws DorisStartException {
|
||||
try {
|
||||
sqlSessionWrapper.startBatchSession(CommandMapper.class, createCommandBatchFunction, commandInfo);
|
||||
taskService.changeTaskStatus(commandInfo.getTaskId(), StateEnum.RUNNING.getStateNum());
|
||||
} catch (Exception e) {
|
||||
throw new DorisStartException(e, commandInfo.getTaskId());
|
||||
}
|
||||
@@ -92,7 +93,10 @@ public class CommandService {
|
||||
try {
|
||||
sqlSessionWrapper.startBatchSession(CommandMapper.class, function, taskCommandInfos);
|
||||
} catch (Exception e) {
|
||||
TaskCommandInfo info = taskCommandInfos.get(0);
|
||||
TaskCommandInfo info = null;
|
||||
if (taskCommandInfos != null) {
|
||||
info = taskCommandInfos.get(0);
|
||||
}
|
||||
Long taskId = null;
|
||||
if (info != null) {
|
||||
taskId = info.getTaskId();
|
||||
|
||||
@@ -35,7 +35,7 @@ public class ProjectObjectDataListener implements ReadListener<ProtectObject> {
|
||||
private void saveData() {
|
||||
Boolean success = protectObjectService.newProtectObjects(cachedDataList);
|
||||
if (!success) {
|
||||
throw new RuntimeException("Error reading data in /proobj/new");
|
||||
throw new RuntimeException("在/proobj/upload中读取数据时出现了错误");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class ProtectObjectController implements ProtectObjectControllerApi {
|
||||
@Override
|
||||
@PostMapping("/upload")
|
||||
public ResponseResult uploadFile(
|
||||
@NotNull(message = "uploadFile cannot be null. ") MultipartFile uploadFile
|
||||
@NotNull(message = "uploadFile字段不能为空") MultipartFile uploadFile
|
||||
) throws IOException {
|
||||
EasyExcel.read(uploadFile.getInputStream(), ProtectObject.class,
|
||||
new ProjectObjectDataListener(protectObjectService)).sheet().doRead();
|
||||
@@ -85,6 +85,10 @@ public class ProtectObjectController implements ProtectObjectControllerApi {
|
||||
@GetMapping("/{protectObjectId}/query")
|
||||
public ResponseResult queryProtectObject(@PathVariable Integer protectObjectId) throws IllegalAccessException {
|
||||
ProtectObject protectObject = protectObjectService.queryProtectObject(protectObjectId);
|
||||
if (protectObject == null) {
|
||||
return ResponseResult.invalid()
|
||||
.setMessage("无效的防护对象ID,也许该ID指定的防护对象不存在?");
|
||||
}
|
||||
return ResponseResult.ok()
|
||||
.setDataMap(EntityUtils.entityToMap(protectObject));
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public interface ProtectObjectControllerApi {
|
||||
requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "上传文件")
|
||||
)
|
||||
ResponseResult uploadFile(
|
||||
@NotNull(message = "uploadFile cannot be null. ") MultipartFile uploadFile
|
||||
@NotNull(message = "uploadFile字段不能为空") MultipartFile uploadFile
|
||||
) throws IOException;
|
||||
|
||||
@GetMapping("/download")
|
||||
|
||||
@@ -102,7 +102,7 @@ public class ProtectObjectService {
|
||||
public Map<String, Object> changeProtectObjectAuditStatus(Integer protectObjectId, Integer auditStatus) {
|
||||
Integer originalAuditStatus = protectObjectMapper.queryProtectObject(protectObjectId).getProtectObjectAuditStatus();
|
||||
if (!AuditStatusValidator.setOriginal(originalAuditStatus).checkValidate(auditStatus)) {
|
||||
throw new IllegalArgumentException("invalid audit status");
|
||||
throw new IllegalArgumentException("无效的审核状态");
|
||||
}
|
||||
Boolean success = protectObjectMapper.changeProtectObjectAuditStatus(protectObjectId, auditStatus);
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public class TemplateController implements TemplateControllerApi {
|
||||
Template template = templateService.queryTemplate(templateId);
|
||||
if (template == null) {
|
||||
return ResponseResult.invalid()
|
||||
.setMessage("invalid templateId, maybe this template doesn't exist?");
|
||||
.setMessage("无效的策略模板ID,也许该模板不存在?");
|
||||
}
|
||||
return ResponseResult.ok()
|
||||
.setDataMap(EntityUtils.entityToMap(template));
|
||||
|
||||
@@ -95,7 +95,7 @@ public class StaticRuleController implements StaticRuleControllerApi {
|
||||
@Override
|
||||
@PostMapping("/{id}/update")
|
||||
public ResponseResult updateStaticRule(@PathVariable Integer id,
|
||||
@RequestBody @Valid StaticRuleObject object) {
|
||||
@RequestBody @Valid StaticRuleObject object) {
|
||||
log.info("修改静态规则: {}", object);
|
||||
//调用service修改
|
||||
Integer updateValid = staticRuleService.updateStaticRule(id, object);
|
||||
|
||||
@@ -99,7 +99,7 @@ public class TaskController implements TaskControllerApi {
|
||||
|
||||
@Override
|
||||
@GetMapping("/{taskId}/running/{stateNum}")
|
||||
public ResponseResult changeTaskStatus(@PathVariable @NotNull Integer stateNum,
|
||||
public ResponseResult changeTaskStatus(@PathVariable @NotNull @Min(0) @Max(6) Integer stateNum,
|
||||
@PathVariable @NotNull Long taskId) throws DorisStartException {
|
||||
return ResponseResult.ok()
|
||||
.setData("task_id", taskId)
|
||||
|
||||
@@ -160,6 +160,6 @@ public interface TaskControllerApi {
|
||||
@Parameter(name = "stateNum", description = "任务状态编号任务状态(0为未启动,1为生成中,2为运行中,3为暂停中,4为已停止,5为已结束,6为失败)")
|
||||
}
|
||||
)
|
||||
ResponseResult changeTaskStatus(@PathVariable @NotNull Integer stateNum,
|
||||
ResponseResult changeTaskStatus(@PathVariable @NotNull @Min(0) @Max(6) Integer stateNum,
|
||||
@PathVariable @NotNull Long taskId) throws DorisStartException;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class TaskService {
|
||||
public Boolean changeTaskAuditStatus(Long taskId, Integer taskAuditStatus) {
|
||||
Integer originalAuditStatus = taskMapper.queryTaskAuditStatus(taskId);
|
||||
if (originalAuditStatus == null) {
|
||||
throw new IllegalArgumentException("cannot find audit status of task " + taskId + ", maybe task doesn't exist?");
|
||||
throw new IllegalArgumentException("无法找到任务ID为" + taskId + "的任务,也许任务不存在?");
|
||||
}
|
||||
|
||||
if (AuditStatusValidator.setOriginal(originalAuditStatus).checkValidate(taskAuditStatus))
|
||||
|
||||
@@ -9,6 +9,8 @@ import com.realtime.protection.server.task.TaskService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class StateChangeService {
|
||||
@@ -22,9 +24,14 @@ public class StateChangeService {
|
||||
|
||||
@DSTransactional
|
||||
public Boolean changeState(Integer stateNum, Long taskId) throws DorisStartException {
|
||||
if (Objects.equals(stateNum, StateEnum.GENERATING.getStateNum()) ||
|
||||
Objects.equals(stateNum, StateEnum.FAILED.getStateNum())) {
|
||||
throw new IllegalArgumentException("非法任务状态:" + StateEnum.getStateByNum(stateNum));
|
||||
}
|
||||
|
||||
Integer originalStateNum = taskService.queryTaskStatus(taskId);
|
||||
if (originalStateNum == null) {
|
||||
throw new IllegalArgumentException("cannot find status of task " + taskId + ", maybe task doesn't exist?");
|
||||
throw new IllegalArgumentException("无法找到" + taskId + "的任务状态,也许任务ID不存在?");
|
||||
}
|
||||
|
||||
State originalState = StateEnum.getStateByNum(originalStateNum);
|
||||
@@ -39,7 +46,7 @@ public class StateChangeService {
|
||||
return false;
|
||||
}
|
||||
|
||||
log.debug(String.format("successfully let task(%d) change state from %s to %s",
|
||||
log.debug(String.format("成功使得task(%d)从%s切换为%s",
|
||||
taskId,
|
||||
originalState.getClass().getSimpleName(),
|
||||
newState.getClass().getSimpleName()));
|
||||
|
||||
@@ -16,13 +16,13 @@ public class StateHandler {
|
||||
Task task = taskService.queryTask(taskId);
|
||||
|
||||
if (task == null) {
|
||||
throw new IllegalArgumentException("invalid task id");
|
||||
throw new IllegalArgumentException("无效task_id,因为无法找到对应任务");
|
||||
}
|
||||
|
||||
Integer taskAuditStatus = task.getTaskAuditStatus();
|
||||
|
||||
if (taskAuditStatus == null) {
|
||||
throw new IllegalArgumentException("invalid task id, because task_audit_status is null");
|
||||
throw new IllegalArgumentException("无效的task_id,因为task_audit_status为空");
|
||||
}
|
||||
|
||||
// 如果审核状态不为已通过审核,则无效
|
||||
@@ -74,7 +74,7 @@ public class StateHandler {
|
||||
// 如果未能获取staticTaskCommandInfos,需要报错
|
||||
List<TaskCommandInfo> staticTaskCommandInfos = taskService.getStaticCommandInfos(taskId);
|
||||
if (staticTaskCommandInfos == null || staticTaskCommandInfos.isEmpty()) {
|
||||
throw new IllegalArgumentException("static rules are empty, need to choose at least one static rule");
|
||||
throw new IllegalArgumentException("静态规则列表为空,请至少选择一个静态规则以启动任务");
|
||||
}
|
||||
|
||||
commandService.createCommands(staticTaskCommandInfos);
|
||||
|
||||
@@ -38,7 +38,7 @@ public class WhiteListController implements WhiteListControllerApi {
|
||||
//post
|
||||
@Override
|
||||
@PostMapping("/upload")
|
||||
public ResponseResult uploadFile(MultipartFile uploadFile) throws IOException {
|
||||
public ResponseResult uploadFile(MultipartFile uploadFile) throws IOException {
|
||||
EasyExcel.read(uploadFile.getInputStream(), WhiteListObject.class,
|
||||
new WhiteListDataListener(whiteListService)).sheet().doRead();
|
||||
return ResponseResult.ok();
|
||||
|
||||
@@ -34,7 +34,7 @@ public interface WhiteListControllerApi {
|
||||
requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(
|
||||
description = "白名单信息")
|
||||
)
|
||||
ResponseResult newWhitelistObject(@RequestBody WhiteListObject object) ;
|
||||
ResponseResult newWhitelistObject(@RequestBody WhiteListObject object);
|
||||
|
||||
@Operation(
|
||||
summary = "批量导入白名单",
|
||||
@@ -51,7 +51,7 @@ public interface WhiteListControllerApi {
|
||||
requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(
|
||||
description = "Excel文件")
|
||||
)
|
||||
ResponseResult uploadFile(MultipartFile uploadFile) throws IOException ;
|
||||
ResponseResult uploadFile(MultipartFile uploadFile) throws IOException;
|
||||
|
||||
@Operation(
|
||||
summary = "下载白名单模板",
|
||||
@@ -66,7 +66,7 @@ public interface WhiteListControllerApi {
|
||||
)
|
||||
}
|
||||
)
|
||||
void downloadTemplate(HttpServletResponse response) throws IOException ;
|
||||
void downloadTemplate(HttpServletResponse response) throws IOException;
|
||||
|
||||
@Operation(
|
||||
summary = "查询白名单",
|
||||
@@ -88,9 +88,9 @@ public interface WhiteListControllerApi {
|
||||
}
|
||||
)
|
||||
ResponseResult queryWhiteListObject(@RequestParam(value = "whiteobj_name", required = false) String whiteListName,
|
||||
@RequestParam(value = "whiteobj_id", required = false) Integer whiteListId,
|
||||
@RequestParam(value = "page", defaultValue = "1") Integer page,
|
||||
@RequestParam(value = "page_size", defaultValue = "10") Integer pageSize) ;
|
||||
@RequestParam(value = "whiteobj_id", required = false) Integer whiteListId,
|
||||
@RequestParam(value = "page", defaultValue = "1") Integer page,
|
||||
@RequestParam(value = "page_size", defaultValue = "10") Integer pageSize);
|
||||
|
||||
@Operation(
|
||||
summary = "查询单个白名单",
|
||||
@@ -108,7 +108,7 @@ public interface WhiteListControllerApi {
|
||||
@Parameter(name = "id", description = "白名单ID", example = "2")
|
||||
}
|
||||
)
|
||||
ResponseResult queryWhiteListObjectById(@PathVariable Integer id) ;
|
||||
ResponseResult queryWhiteListObjectById(@PathVariable Integer id);
|
||||
|
||||
@Operation(
|
||||
summary = "删除白名单",
|
||||
@@ -144,7 +144,7 @@ public interface WhiteListControllerApi {
|
||||
@Parameter(name = "ids", description = "白名单id数组")
|
||||
}
|
||||
)
|
||||
ResponseResult deleteWhiteListObjects(@PathVariable List<Integer> whiteListObjIds) ;
|
||||
ResponseResult deleteWhiteListObjects(@PathVariable List<Integer> whiteListObjIds);
|
||||
|
||||
@Operation(
|
||||
summary = "修改白名单",
|
||||
@@ -166,7 +166,7 @@ public interface WhiteListControllerApi {
|
||||
|
||||
)
|
||||
ResponseResult updateWhiteListObject(@PathVariable Integer id,
|
||||
@RequestBody WhiteListObject object) ;
|
||||
@RequestBody WhiteListObject object);
|
||||
|
||||
@Operation(
|
||||
summary = "修改白名单审核状态",
|
||||
@@ -186,9 +186,7 @@ public interface WhiteListControllerApi {
|
||||
}
|
||||
)
|
||||
ResponseResult updateWhiteListObjectAuditStatus(@PathVariable Integer id,
|
||||
@PathVariable Integer auditStatus) ;
|
||||
@PathVariable Integer auditStatus);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ public interface WhiteListMapper {
|
||||
@Delete("delete from t_white_list where white_list_id = #{id}")
|
||||
Integer deleteWhiteListObject(Integer id);
|
||||
|
||||
Integer updateWhiteListObject(@Param("id")Integer id, @Param("object") WhiteListObject object);
|
||||
Integer updateWhiteListObject(@Param("id") Integer id, @Param("object") WhiteListObject object);
|
||||
|
||||
List<String> existWhiteListObject(@Param("staticRuleObject") StaticRuleObject staticRuleObject);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user