From d20b37fd0a6c6d498097d761096a9dea326d8231 Mon Sep 17 00:00:00 2001 From: chenlinghy Date: Mon, 11 May 2020 10:56:24 +0800 Subject: [PATCH] =?UTF-8?q?OCT=20REM:=201.=20=E4=BF=AE=E6=94=B9=E5=81=9C?= =?UTF-8?q?=E6=AD=A2=E6=8C=87=E5=AE=9A=E4=BB=BB=E5=8A=A1=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=92=8C=E8=8E=B7=E5=8F=96=E5=A4=84=E7=BD=AE=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E8=AF=A6=E7=BB=86=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3=E7=9A=84?= =?UTF-8?q?=E5=89=A9=E4=BD=99=E6=97=B6=E9=97=B4=202.=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E7=AE=A1=E7=90=86=E7=9A=84=E5=86=92=E7=83=9F?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/dispose/controller/DisposeTaskController.java | 4 ++-- .../com/dispose/controller/TaskControllerSmokeTest.java | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) 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")