update getAlarmListData 14/71514/1
authorguochuyicmri <guochuyi@chinamobile.com>
Wed, 31 Oct 2018 02:12:40 +0000 (10:12 +0800)
committerguochuyicmri <guochuyi@chinamobile.com>
Wed, 31 Oct 2018 02:12:53 +0000 (10:12 +0800)
Change-Id: I1d607a67b2912d32bf49e478954f247978f1f8ee
Issue-ID: USECASEUI-165
Signed-off-by: guochuyicmri <guochuyi@chinamobile.com>
server/src/main/java/org/onap/usecaseui/server/controller/AlarmController.java
server/src/test/java/org/onap/usecaseui/server/controller/AlarmControllerTest.java

index 1a032c4..091df4a 100755 (executable)
@@ -105,13 +105,13 @@ public class AlarmController
     public String getAlarmData(@PathVariable(required = false) String sourceName,\r
                                @PathVariable(required = false) String priority,@PathVariable(required = false) String startTime,\r
                                @PathVariable(required = false) String endTime,@PathVariable(required = false) String vfStatus,\r
-                               @PathVariable int currentPage, @PathVariable int pageSize) throws JsonProcessingException, ParseException {\r
+                               @PathVariable String currentPage, @PathVariable String pageSize) throws JsonProcessingException, ParseException {\r
             AlarmsHeader alarm = new AlarmsHeader();\r
             alarm.setSourceName(sourceName);\r
             alarm.setStatus(vfStatus);\r
-            alarm.setStartEpochMicrosec(UuiCommonUtil.isNotNullOrEmpty(startTime)?null:new SimpleDateFormat(Constant.DATE_FORMAT).parse(startTime).getTime()+"");\r
-            alarm.setLastEpochMicroSec(UuiCommonUtil.isNotNullOrEmpty(endTime)?null:new SimpleDateFormat(Constant.DATE_FORMAT).parse(endTime).getTime()+"");\r
-            Page  pa = alarmsHeaderService.queryAlarmsHeader(alarm,currentPage,pageSize);\r
+            alarm.setStartEpochMicrosec(!UuiCommonUtil.isNotNullOrEmpty(startTime)?null:new SimpleDateFormat(Constant.DATE_FORMAT).parse(startTime).getTime()+"");\r
+            alarm.setLastEpochMicroSec(!UuiCommonUtil.isNotNullOrEmpty(endTime)?null:new SimpleDateFormat(Constant.DATE_FORMAT).parse(endTime).getTime()+"");\r
+            Page  pa = alarmsHeaderService.queryAlarmsHeader(alarm,Integer.parseInt(currentPage),Integer.parseInt(pageSize));\r
         try {\r
             Map<String,Object> map = new HashMap<>();\r
             map.put("alarms",pa.getList());\r
index 0054ab1..3bce961 100755 (executable)
@@ -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();
                }