diff options
author | guochuyicmri <guochuyi@chinamobile.com> | 2018-10-31 10:12:40 +0800 |
---|---|---|
committer | guochuyicmri <guochuyi@chinamobile.com> | 2018-10-31 10:12:53 +0800 |
commit | 8fbc07a14c8aa4adcdcedb7ffddd43514b0872e2 (patch) | |
tree | cb87ed9378e6f56406ffaec570677d851bd69b73 | |
parent | 2c820d62f6674bbdd9dde7e1a29ae6740dfd50c4 (diff) |
update getAlarmListData
Change-Id: I1d607a67b2912d32bf49e478954f247978f1f8ee
Issue-ID: USECASEUI-165
Signed-off-by: guochuyicmri <guochuyi@chinamobile.com>
-rwxr-xr-x | server/src/main/java/org/onap/usecaseui/server/controller/AlarmController.java | 8 | ||||
-rwxr-xr-x | server/src/test/java/org/onap/usecaseui/server/controller/AlarmControllerTest.java | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/server/src/main/java/org/onap/usecaseui/server/controller/AlarmController.java b/server/src/main/java/org/onap/usecaseui/server/controller/AlarmController.java index 1a032c48..091df4a9 100755 --- a/server/src/main/java/org/onap/usecaseui/server/controller/AlarmController.java +++ b/server/src/main/java/org/onap/usecaseui/server/controller/AlarmController.java @@ -105,13 +105,13 @@ public class AlarmController public String getAlarmData(@PathVariable(required = false) String sourceName,
@PathVariable(required = false) String priority,@PathVariable(required = false) String startTime,
@PathVariable(required = false) String endTime,@PathVariable(required = false) String vfStatus,
- @PathVariable int currentPage, @PathVariable int pageSize) throws JsonProcessingException, ParseException {
+ @PathVariable String currentPage, @PathVariable String pageSize) throws JsonProcessingException, ParseException {
AlarmsHeader alarm = new AlarmsHeader();
alarm.setSourceName(sourceName);
alarm.setStatus(vfStatus);
- alarm.setStartEpochMicrosec(UuiCommonUtil.isNotNullOrEmpty(startTime)?null:new SimpleDateFormat(Constant.DATE_FORMAT).parse(startTime).getTime()+"");
- alarm.setLastEpochMicroSec(UuiCommonUtil.isNotNullOrEmpty(endTime)?null:new SimpleDateFormat(Constant.DATE_FORMAT).parse(endTime).getTime()+"");
- Page pa = alarmsHeaderService.queryAlarmsHeader(alarm,currentPage,pageSize);
+ alarm.setStartEpochMicrosec(!UuiCommonUtil.isNotNullOrEmpty(startTime)?null:new SimpleDateFormat(Constant.DATE_FORMAT).parse(startTime).getTime()+"");
+ alarm.setLastEpochMicroSec(!UuiCommonUtil.isNotNullOrEmpty(endTime)?null:new SimpleDateFormat(Constant.DATE_FORMAT).parse(endTime).getTime()+"");
+ Page pa = alarmsHeaderService.queryAlarmsHeader(alarm,Integer.parseInt(currentPage),Integer.parseInt(pageSize));
try {
Map<String,Object> map = new HashMap<>();
map.put("alarms",pa.getList());
diff --git a/server/src/test/java/org/onap/usecaseui/server/controller/AlarmControllerTest.java b/server/src/test/java/org/onap/usecaseui/server/controller/AlarmControllerTest.java index 0054ab10..3bce961d 100755 --- a/server/src/test/java/org/onap/usecaseui/server/controller/AlarmControllerTest.java +++ b/server/src/test/java/org/onap/usecaseui/server/controller/AlarmControllerTest.java @@ -60,8 +60,8 @@ public class AlarmControllerTest { @Test public void testGetAlarmData() throws Exception { try { - controller.getAlarmData("sourceName", "priority", "startTime", "endTime", "vfStatus", 1, 10); - controller.getAlarmData(null, null, null, null, null, 1, 10); + controller.getAlarmData("sourceName", "priority", "startTime", "endTime", "vfStatus", "1", "10"); + controller.getAlarmData(null, null, null, null, null, "1", "10"); } catch (Exception e) { e.printStackTrace(); } |