X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ecomp-portal-BE-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fportalapp%2Fportal%2Fcontroller%2FUserNotificationController.java;h=cec01bad06c9690c1b752b375766e4abb1274b96;hb=cc6ee26dd12723032eb026e79f71a0fdd35dde03;hp=0dfccc9c96a51f734fb2a625f221d1bb7fdde429;hpb=21e503048d2d083e532064de6aab0fcb7ae0dea1;p=portal.git diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/UserNotificationController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/UserNotificationController.java index 0dfccc9c..cec01bad 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/UserNotificationController.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/UserNotificationController.java @@ -4,13 +4,15 @@ * =================================================================== * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== + * Modifications Copyright (c) 2020 IBM + * =================================================================== * * Unless otherwise specified, all software contained herein is licensed * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -50,6 +52,8 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -87,8 +91,8 @@ public class UserNotificationController extends EPRestrictedBaseController { private static final String SUCCESS = "success"; private static final String FAILURE = "FAILURE"; - @RequestMapping(value = { - "/portalApi/getFunctionalMenuRole" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/portalApi/getFunctionalMenuRole" }, produces = "application/json") public List getMenuIdRoleId(HttpServletRequest request, HttpServletResponse response) { // EPUser user = EPUserUtils.getUserSession(request); List menuRoleList = null; @@ -96,8 +100,8 @@ public class UserNotificationController extends EPRestrictedBaseController { return menuRoleList; } - @RequestMapping(value = { - "/portalApi/getNotifications" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/portalApi/getNotifications" }, produces = "application/json") public PortalRestResponse> getNotifications(HttpServletRequest request, HttpServletResponse response) { EPUser user = EPUserUtils.getUserSession(request); @@ -114,8 +118,8 @@ public class UserNotificationController extends EPRestrictedBaseController { return portalRestResponse; } - @RequestMapping(value = { - "/portalApi/getAdminNotifications" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/portalApi/getAdminNotifications" }, produces = "application/json") public List getAdminNotifications(HttpServletRequest request, HttpServletResponse response) { List adminNotificationList = null; EPUser user = EPUserUtils.getUserSession(request); @@ -123,7 +127,7 @@ public class UserNotificationController extends EPRestrictedBaseController { return adminNotificationList; } - @RequestMapping(value = "/portalApi/saveNotification", method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = "/portalApi/saveNotification", produces = "application/json") public PortalRestResponse save(HttpServletRequest request, HttpServletResponse response, @RequestBody EpNotificationItem notificationItem) { @@ -160,8 +164,8 @@ public class UserNotificationController extends EPRestrictedBaseController { return new PortalRestResponse<>(PortalRestStatusEnum.OK, "SUCCESS", ""); } - @RequestMapping(value = { - "/portalApi/notificationUpdateRate" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/portalApi/notificationUpdateRate" }, produces = "application/json") public PortalRestResponse> getNotificationUpdateRate(HttpServletRequest request) { try { String updateRate = SystemProperties.getProperty(EPCommonSystemProperties.NOTIFICATION_UPDATE_RATE); @@ -178,8 +182,8 @@ public class UserNotificationController extends EPRestrictedBaseController { } } - @RequestMapping(value = { - "/portalApi/notificationRead" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/portalApi/notificationRead" }, produces = "application/json") public PortalRestResponse> notificationRead( @RequestParam("notificationId") String notificationID, HttpServletRequest request) { try { @@ -191,8 +195,8 @@ public class UserNotificationController extends EPRestrictedBaseController { } } - @RequestMapping(value = { - "/portalApi/getNotificationHistory" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/portalApi/getNotificationHistory" }, produces = "application/json") public List getNotificationHistory(HttpServletRequest request, HttpServletResponse response) { EPUser user = EPUserUtils.getUserSession(request); List notificationList = null; @@ -200,8 +204,7 @@ public class UserNotificationController extends EPRestrictedBaseController { return notificationList; } - @RequestMapping(value = { "/portalApi/notificationRole/{notificationId}/roles" }, method = { - RequestMethod.GET }, produces = "application/json") + @GetMapping(value = { "/portalApi/notificationRole/{notificationId}/roles" }, produces = "application/json") public List testGetRoles(HttpServletRequest request, @PathVariable("notificationId") Long notificationId) { List notifRoles = userNotificationService.getNotificationRoles(notificationId); ArrayList rolesList = new ArrayList<>(); @@ -211,8 +214,7 @@ public class UserNotificationController extends EPRestrictedBaseController { return rolesList; } - @RequestMapping(value = { "/portalApi/getNotificationAppRoles" }, method = { - RequestMethod.GET }, produces = "application/json") + @GetMapping(value = { "/portalApi/getNotificationAppRoles" }, produces = "application/json") public List getNotificationAppRoles(HttpServletRequest request, HttpServletResponse response) { List epAppRoleList = null; try { @@ -225,8 +227,8 @@ public class UserNotificationController extends EPRestrictedBaseController { return epAppRoleList; } - @RequestMapping(value = { - "/portalApi/getMessageRecipients" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { + "/portalApi/getMessageRecipients" }, produces = "application/json") public List getMessageRecipients(@RequestParam("notificationId") Long notificationID) { // EPUser user = EPUserUtils.getUserSession(request); List messageUserRecipients = null;