diff --git a/src/main/java/com/dispose/controller/DisposeTaskController.java b/src/main/java/com/dispose/controller/DisposeTaskController.java index 4c069d78..3a340666 100644 --- a/src/main/java/com/dispose/controller/DisposeTaskController.java +++ b/src/main/java/com/dispose/controller/DisposeTaskController.java @@ -194,7 +194,7 @@ public class DisposeTaskController { taskData.setType(taskInfo.getType()); taskData.setDisposeIp(taskInfo.getDisposeIp()); taskData.setLeftTime(Math.abs(Helper.getTimestampDiffNow(taskInfo.getBeginTime()) - - Helper.getTimestampDiffNow(taskInfo.getPlanEndTime()))); + - Helper.getTimestampDiffNow(taskInfo.getPlanEndTime())) /60 ); taskData.setStatus(retError.getCode()); taskData.setMessage(retError.getMsg()); @@ -528,7 +528,7 @@ public class DisposeTaskController { .taskId(v.getId().toString()) .type(v.getType()) .startTime(Helper.getTimestampSecond(v.getBeginTime())) - .disposeTime(diff) + .disposeTime(diff / 60) .disposeIp(v.getDisposeIp()) .attackType(Helper.attackStringToArray(v.getAttackType())) .flowDirection(v.getFlowDirection()) diff --git a/src/test/java/com/dispose/controller/TaskControllerSmokeTest.java b/src/test/java/com/dispose/controller/TaskControllerSmokeTest.java index f8389e07..1e23a958 100644 --- a/src/test/java/com/dispose/controller/TaskControllerSmokeTest.java +++ b/src/test/java/com/dispose/controller/TaskControllerSmokeTest.java @@ -54,7 +54,7 @@ public class TaskControllerSmokeTest extends InitTestEnvironment { String reqData = "{\"ver\":2,\"cryptoType\":0,\"timeStamp\":1587604296988," + "\"msgContent\":\"{\\\"id\\\":-1," + "\\\"type\\\":0, " + - "\\\"disposeIp\\\":\\\"192.168.5.5\\\", " + + "\\\"disposeIp\\\":\\\"192.168.3.2\\\", " + "\\\"disposeTime\\\":120}\"}"; String taskStart = mockMvc.perform(MockMvcRequestBuilders @@ -88,7 +88,7 @@ public class TaskControllerSmokeTest extends InitTestEnvironment { @Test public void t2_NormalStopTaskTest() throws Exception { String reqData = "{\"ver\":2,\"cryptoType\":0,\"timeStamp\":1587604296988," + - "\"msgContent\":\"{\\\"taskId\\\":[\\\"236\\\", \\\"235\\\" ]}\"}"; + "\"msgContent\":\"{\\\"taskId\\\":[\\\"1\\\", \\\"2\\\" ]}\"}"; String taskStop = mockMvc.perform(MockMvcRequestBuilders .post("/task/stop") @@ -135,7 +135,7 @@ public class TaskControllerSmokeTest extends InitTestEnvironment { @Test public void t3_NormalStopTaskByDisposeIpTest() throws Exception { String reqData = "{\"ver\":2,\"cryptoType\":0,\"timeStamp\":1587604296988,\"msgContent\": \"{\\\"items\\\":" + - "[{\\\"id\\\":\\\"1\\\",\\\"type\\\":0,\\\"disposeIp\\\":\\\"192.168.3.4\\\"}]}\"}"; + "[{\\\"id\\\":\\\"1\\\",\\\"type\\\":0,\\\"disposeIp\\\":\\\"192.168.3.2\\\"}]}\"}"; String taskStopByIp = mockMvc.perform(MockMvcRequestBuilders .post("/task/stop_ip") @@ -181,7 +181,7 @@ public class TaskControllerSmokeTest extends InitTestEnvironment { @Test public void t4_NormalGetNodeDetailedInfoTest() throws Exception { String reqData = "{\"ver\":2,\"cryptoType\":0,\"timeStamp\":1587604296988," + - "\"msgContent\":\"{\\\"taskId\\\":[\\\"277\\\"]}\"}"; + "\"msgContent\":\"{\\\"taskId\\\":[\\\"1\\\", \\\"2\\\"]}\"}"; String getNodeDetailedInfo = mockMvc.perform(MockMvcRequestBuilders .post("/task/get")