diff options
author | guochuyicmri <guochuyi@chinamobile.com> | 2018-10-31 10:23:27 +0800 |
---|---|---|
committer | guochuyicmri <guochuyi@chinamobile.com> | 2018-10-31 10:23:36 +0800 |
commit | 9168c54611ad28f04d269291011779e5f4b286f3 (patch) | |
tree | 71d1fc7130b7a68c007a15409027e42c5195924b | |
parent | 8fbc07a14c8aa4adcdcedb7ffddd43514b0872e2 (diff) |
update getPerformanceDatas
Change-Id: Ifa2777f9089b107e337b305f928acb267451d605
Issue-ID: USECASEUI-166
Signed-off-by: guochuyicmri <guochuyi@chinamobile.com>
-rwxr-xr-x | server/src/main/java/org/onap/usecaseui/server/controller/PerformanceController.java | 10 | ||||
-rwxr-xr-x | server/src/test/java/org/onap/usecaseui/server/controller/PerformanceControllerTest.java | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/server/src/main/java/org/onap/usecaseui/server/controller/PerformanceController.java b/server/src/main/java/org/onap/usecaseui/server/controller/PerformanceController.java index 251f3597..d113f164 100755 --- a/server/src/main/java/org/onap/usecaseui/server/controller/PerformanceController.java +++ b/server/src/main/java/org/onap/usecaseui/server/controller/PerformanceController.java @@ -73,16 +73,16 @@ public class PerformanceController { private ObjectMapper omPerformance = new ObjectMapper(); @RequestMapping(value = {"/performance/{currentPage}/{pageSize}","/performance/{currentPage}/{pageSize}/{sourceName}/{startTime}/{endTime}"},method = RequestMethod.GET, produces = "application/json") - public String getPerformanceData(@PathVariable int currentPage, - @PathVariable int pageSize, + public String getPerformanceData(@PathVariable String currentPage, + @PathVariable String pageSize, @PathVariable(required = false) String sourceName, @PathVariable(required = false) String startTime,@PathVariable(required = false) String endTime) throws JsonProcessingException, ParseException { Page<PerformanceHeader> pa = new Page<PerformanceHeader>(); PerformanceHeader performanceHeader = new PerformanceHeader(); performanceHeader.setSourceName(sourceName); - performanceHeader.setStartEpochMicrosec(UuiCommonUtil.isNotNullOrEmpty(startTime)?null:new SimpleDateFormat(Constant.DATE_FORMAT).parse(startTime).getTime()+""); - performanceHeader.setLastEpochMicroSec(UuiCommonUtil.isNotNullOrEmpty(endTime)?null:new SimpleDateFormat(Constant.DATE_FORMAT).parse(endTime).getTime()+""); - pa = performanceHeaderService.queryPerformanceHeader(performanceHeader,currentPage,pageSize); + performanceHeader.setStartEpochMicrosec(!UuiCommonUtil.isNotNullOrEmpty(startTime)?null:new SimpleDateFormat(Constant.DATE_FORMAT).parse(startTime).getTime()+""); + performanceHeader.setLastEpochMicroSec(!UuiCommonUtil.isNotNullOrEmpty(endTime)?null:new SimpleDateFormat(Constant.DATE_FORMAT).parse(endTime).getTime()+""); + pa = performanceHeaderService.queryPerformanceHeader(performanceHeader,Integer.parseInt(currentPage),Integer.parseInt(pageSize)); try { Map<String,Object> map = new HashMap<>(); map.put("performances",pa.getList()); diff --git a/server/src/test/java/org/onap/usecaseui/server/controller/PerformanceControllerTest.java b/server/src/test/java/org/onap/usecaseui/server/controller/PerformanceControllerTest.java index 3034ed37..1e4ec915 100755 --- a/server/src/test/java/org/onap/usecaseui/server/controller/PerformanceControllerTest.java +++ b/server/src/test/java/org/onap/usecaseui/server/controller/PerformanceControllerTest.java @@ -63,8 +63,8 @@ public class PerformanceControllerTest { PerformanceHeader header = new PerformanceHeader(); - controller.getPerformanceData(currentPage,pageSize,sourceName,startTime,endTime); - controller.getPerformanceData(currentPage,pageSize,null,null,null); + controller.getPerformanceData(currentPage+"",pageSize+"",sourceName,startTime,endTime); + controller.getPerformanceData(currentPage+"",pageSize+"",null,null,null); verify(phs,times(1)).queryPerformanceHeader(header,currentPage,pageSize); } |