diff --git a/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/http/ui.xml b/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/http/ui.xml index 8b2b5902..1cdcd217 100644 --- a/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/http/ui.xml +++ b/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/http/ui.xml @@ -1,5 +1,5 @@ - + diff --git a/Bench4Q-Master/src/main/java/org/bench4q/master/api/ScriptController.java b/Bench4Q-Master/src/main/java/org/bench4q/master/api/ScriptController.java index dbfa49cf..96cb5e77 100644 --- a/Bench4Q-Master/src/main/java/org/bench4q/master/api/ScriptController.java +++ b/Bench4Q-Master/src/main/java/org/bench4q/master/api/ScriptController.java @@ -102,14 +102,14 @@ public class ScriptController extends BaseController { if (!this.checkScope(UserService.NORAML_AUTHENTICATION)) { return buildReponseModel(false, "has no power for recording script!!!", "", -1, null, null, - null,null); + null); } Port port = new Port(); synchronized (PORT_LOCK) { port = this.getPortPoolService().getAPortNotInUse(); if (port == null) { return buildReponseModel(false, "port is in use!", "", -1, - null, null, null,null); + null, null, null); } } UUID uuid = UUID.randomUUID(); @@ -118,7 +118,7 @@ public class ScriptController extends BaseController { return buildReponseModel(true, "", this.getScriptCapturer() .getIpHttpCaptureServerAdress(), port.getPort(), null, null, - uuid.toString(),null); + uuid.toString()); } @RequestMapping(value = "/startScriptRecording", method = { @@ -129,13 +129,13 @@ public class ScriptController extends BaseController { if (!checkScope(UserService.NORAML_AUTHENTICATION)) { return buildReponseModel(false, "has no power for stopScriptCapture!!!", "", -1, null, - null, null,null); + null, null); } this.getScriptCapturer().startRecording(port); return buildReponseModel(true, "RecordServer stop", "", port, null, - null, fileNameUUID,null); + null, fileNameUUID); } private String buildScriptSavePath() { @@ -158,7 +158,7 @@ public class ScriptController extends BaseController { if (!checkScope(UserService.NORAML_AUTHENTICATION)) { return buildReponseModel(false, "has no power for stopScriptCapture!!!", "", -1, null, - null, null,null); + null, null); } this.getScriptCapturer().stopCurrentRecord(port); @@ -167,7 +167,7 @@ public class ScriptController extends BaseController { } return buildReponseModel(true, "RecordServer stop", "", port, null, - null, fileNameUUID,null); + null, fileNameUUID); } @RequestMapping(value = "/saveScriptToDB", method = { RequestMethod.GET, @@ -179,14 +179,14 @@ public class ScriptController extends BaseController { if (!this.checkScope(UserService.NORAML_AUTHENTICATION)) { return buildReponseModel(false, "saveScriptToDB check your scope fail!", "", -1, null, - null, null,null); + null, null); } File file = new File(buildScriptSavePath() + System.getProperty("file.separator") + fileNameUUID + ".xml"); if (!file.exists()) { return buildReponseModel(false, "no that script", null, -1, null, - null, fileNameUUID,null); + null, fileNameUUID); } try { String content = FileUtils.readFileToString(file); @@ -195,10 +195,10 @@ public class ScriptController extends BaseController { this.getPrincipal().getId(), content, null); // this.getUserService().add return buildReponseModel(success, "Save to DataBase!!", "", port, - null, null, null,null); + null, null, null); } catch (Exception e) { return buildReponseModel(false, "exception when read from file", - null, -1, null, null, fileNameUUID,null); + null, -1, null, null, fileNameUUID); } } @@ -218,12 +218,12 @@ public class ScriptController extends BaseController { boolean success = this.getScriptService().saveScript(scriptName, this.getPrincipal().getId(), scenarioModel, paramFiles); logger.info("upload script:" + scenarioModel); - return buildReponseModel(success, null, null, -1, null, null, null,null); + return buildReponseModel(success, null, null, -1, null, null, null); } catch (Exception e) { this.logger.error(ExceptionLog.getStackTrace(e)); return buildReponseModel(false, "The script is not in the right format", null, -1, null, - null, null,null); + null, null); } } @@ -238,23 +238,9 @@ public class ScriptController extends BaseController { this.getPrincipal()); return this.buildReponseModel(true, null, null, 0, - dealWithCollection(scripts), null, null,null); + dealWithCollection(scripts), null, null); } - @RequestMapping(value = "/loadFilterTypeList", method = { RequestMethod.POST, - RequestMethod.GET }) - @ResponseBody - public OperateScriptServerResponseModel loadFilterTypeList() { - if (!this.checkScope(UserService.NORAML_AUTHENTICATION)) { - return null; - } - String[] filterTypeList = this.getScriptService().loadFilterTypeList(); - - return this.buildReponseModel(true, null, null, 0, - null, null, null,filterTypeList); - } - - @RequestMapping(value = "/queryScriptsByDate", method = RequestMethod.POST) @ResponseBody public OperateScriptServerResponseModel queryScriptsByDate( @@ -266,7 +252,7 @@ public class ScriptController extends BaseController { .queryScriptsByCreateTime(startDate, endDate, this.getPrincipal()); return this.buildReponseModel(true, null, null, 0, - dealWithCollection(scripts), null, null,null); + dealWithCollection(scripts), null, null); } private List dealWithCollection(Collection