diff --git a/src/main/java/com/realtime/protection/configuration/entity/task/FiveTupleWithMask.java b/src/main/java/com/realtime/protection/configuration/entity/task/FiveTupleWithMask.java index 2803fac..e868f5d 100644 --- a/src/main/java/com/realtime/protection/configuration/entity/task/FiveTupleWithMask.java +++ b/src/main/java/com/realtime/protection/configuration/entity/task/FiveTupleWithMask.java @@ -11,7 +11,7 @@ import lombok.Data; public class FiveTupleWithMask { @Schema(description = "地址类型(IPv4 or IPv6)", example = "4") @JsonProperty("addr_type") - private Integer addrType; + private Integer addrType = 4; @Schema(description = "源IP", example = "192.168.104.14") @Pattern(regexp = "^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$", message = "源IP:无效IPv4地址") diff --git a/src/main/java/com/realtime/protection/configuration/entity/task/TaskCommandInfo.java b/src/main/java/com/realtime/protection/configuration/entity/task/TaskCommandInfo.java index 76d5345..6296468 100644 --- a/src/main/java/com/realtime/protection/configuration/entity/task/TaskCommandInfo.java +++ b/src/main/java/com/realtime/protection/configuration/entity/task/TaskCommandInfo.java @@ -67,6 +67,10 @@ public class TaskCommandInfo { @JsonProperty("is_valid") private Boolean isValid = true; + @Schema(description = "指令是否已研判", example = "true") + @JsonProperty("is_judged") + private Boolean isJudged = true; + @Schema(description = "五元组信息") @NotNull(message = "五元组信息不能为空。") @JsonProperty("five_tuple_with_mask") diff --git a/src/main/java/com/realtime/protection/server/command/CommandService.java b/src/main/java/com/realtime/protection/server/command/CommandService.java index 91a3835..a04ad37 100644 --- a/src/main/java/com/realtime/protection/server/command/CommandService.java +++ b/src/main/java/com/realtime/protection/server/command/CommandService.java @@ -36,7 +36,6 @@ public class CommandService { commandInfo.setUUID(UUID.randomUUID().toString()); commandMapper.createCommand(commandInfo); return commandInfo.getUUID(); - } public void createCommands(List taskCommandInfos) { diff --git a/src/main/java/com/realtime/protection/server/task/status/StateHandler.java b/src/main/java/com/realtime/protection/server/task/status/StateHandler.java index aea8730..18c4853 100644 --- a/src/main/java/com/realtime/protection/server/task/status/StateHandler.java +++ b/src/main/java/com/realtime/protection/server/task/status/StateHandler.java @@ -48,7 +48,6 @@ public class StateHandler { } protected Boolean handleResume(CommandService commandService, Long taskId) { - commandService.startCommandsByTaskId(taskId); return true; } diff --git a/src/main/resources/mappers/CommandMapper.xml b/src/main/resources/mappers/CommandMapper.xml index 2568575..87c699e 100644 --- a/src/main/resources/mappers/CommandMapper.xml +++ b/src/main/resources/mappers/CommandMapper.xml @@ -17,7 +17,8 @@ #{info.fiveTupleWithMask.maskSourceIP}, #{info.fiveTupleWithMask.maskSourcePort}, #{info.fiveTupleWithMask.maskDestinationIP}, #{info.fiveTupleWithMask.maskDestinationPort}, #{info.fiveTupleWithMask.maskProtocol}, - #{info.startTime}, #{info.endTime}, #{info.isValid}, #{info.isJudged}, + #{info.startTime}, #{info.endTime}, #{info.isValid}, + #{info.isJudged}, 0, 0, NOW(), NOW(), FALSE) @@ -25,7 +26,8 @@ insert into t_command(COMMAND_ID, TASK_ID, TASK_ACT, FREQUENCY, ADDR_TYPE, SRC_IP, SRC_PORT, DST_IP, DST_PORT, PROTOCOL, - MASK_SRC_IP, MASK_SRC_PORT, MASK_DST_IP, MASK_DST_PORT, MASK_PROTOCOL, VALID_TIME, INVALID_TIME, IS_VALID, IS_JUDGED, + MASK_SRC_IP, MASK_SRC_PORT, MASK_DST_IP, MASK_DST_PORT, MASK_PROTOCOL, VALID_TIME, INVALID_TIME, IS_VALID, + IS_JUDGED, SEND_TIMES, SUCCESS_TIMES, CREATE_TIME, LAST_UPDATE, IS_DELETED) values @@ -37,7 +39,8 @@ #{info.fiveTupleWithMask.maskSourceIP}, #{info.fiveTupleWithMask.maskSourcePort}, #{info.fiveTupleWithMask.maskDestinationIP}, #{info.fiveTupleWithMask.maskDestinationPort}, #{info.fiveTupleWithMask.maskProtocol}, - #{info.startTime}, #{info.endTime}, #{info.isValid}, DEFAULT, + #{info.startTime}, #{info.endTime}, #{info.isValid}, + #{info.isJudged}, 0, 0, NOW(), NOW(), FALSE ) @@ -128,7 +131,7 @@ UPDATE t_command - SET IS_JUDGED = #{is_judged}, + SET IS_JUDGED = #{is_judged}, LAST_UPDATE = NOW() WHERE COMMAND_ID = #{command_id} AND IS_DELETED = FALSE @@ -137,7 +140,12 @@