X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ecomp-portal-BE-os%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fportalapp%2Fportal%2Fcontroller%2FDashboardSearchResultController.java;h=c396de9b01c04f6030bd397a74d31d360227c624;hb=3504c843a1322c3a43b9cfe750fdaedfad83c4a8;hp=1dff6040c4424a63e588c2b29c4f4af60f17f521;hpb=21e503048d2d083e532064de6aab0fcb7ae0dea1;p=portal.git diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/DashboardSearchResultController.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/DashboardSearchResultController.java index 1dff6040..c396de9b 100644 --- a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/DashboardSearchResultController.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/DashboardSearchResultController.java @@ -63,6 +63,9 @@ import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -85,7 +88,7 @@ public class DashboardSearchResultController extends EPRestrictedBaseController * Request parameter. * @return Rest response wrapped around a CommonWidgetMeta object. */ - @RequestMapping(value = "/widgetData", method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = "/widgetData", produces = "application/json") public PortalRestResponse getWidgetData(HttpServletRequest request, @RequestParam String resourceType) { if (resourceType !=null){ @@ -104,7 +107,7 @@ public class DashboardSearchResultController extends EPRestrictedBaseController * read from POST body. * @return Rest response wrapped around a String; e.g., "success" or "ERROR" */ - @RequestMapping(value = "/widgetDataBulk", method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = "/widgetDataBulk", produces = "application/json") public PortalRestResponse saveWidgetDataBulk(@RequestBody CommonWidgetMeta commonWidgetMeta) { logger.debug(EELFLoggerDelegate.debugLogger, "saveWidgetDataBulk: argument is {}", commonWidgetMeta); if (commonWidgetMeta.getCategory() == null || commonWidgetMeta.getCategory().trim().equals("")){ @@ -132,7 +135,7 @@ public class DashboardSearchResultController extends EPRestrictedBaseController * read from POST body * @return Rest response wrapped around a String; e.g., "success" or "ERROR" */ - @RequestMapping(value = "/widgetData", method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = "/widgetData", produces = "application/json") public PortalRestResponse saveWidgetData(@RequestBody CommonWidget commonWidget) { logger.debug(EELFLoggerDelegate.debugLogger, "saveWidgetData: argument is {}", commonWidget); if (commonWidget.getCategory() == null || commonWidget.getCategory().trim().equals("")){ @@ -179,7 +182,7 @@ public class DashboardSearchResultController extends EPRestrictedBaseController * read from POST body * @return Rest response wrapped around a String; e.g., "success" or "ERROR" */ - @RequestMapping(value = "/deleteData", method = RequestMethod.POST, produces = "application/json") + @PostMapping(value = "/deleteData", produces = "application/json") public PortalRestResponse deleteWidgetData(@RequestBody CommonWidget commonWidget) { logger.debug(EELFLoggerDelegate.debugLogger, "deleteWidgetData: argument is {}", commonWidget); if(!dataValidator.isValid(commonWidget)) @@ -197,7 +200,7 @@ public class DashboardSearchResultController extends EPRestrictedBaseController * @return Rest response wrapped around a Map of String to List of Search * Result Item. */ - @RequestMapping(value = "/allPortal", method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = "/allPortal", produces = "application/json") public PortalRestResponse>> searchPortal(HttpServletRequest request, @RequestParam String searchString) { if(searchString!=null){ @@ -240,7 +243,7 @@ public class DashboardSearchResultController extends EPRestrictedBaseController * @param request * @return Rest response wrapped around a list of String */ - @RequestMapping(value = "/activeUsers", method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = "/activeUsers", produces = "application/json") public List getActiveUsers(HttpServletRequest request) { List activeUsers = null; List onlineUsers = new ArrayList<>(); @@ -268,7 +271,7 @@ public class DashboardSearchResultController extends EPRestrictedBaseController * @param request * @return Rest response wrapped around a List of String */ - @RequestMapping(value = "/relatedUsers", method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = "/relatedUsers", produces = "application/json") public PortalRestResponse> activeUsers(HttpServletRequest request) { EPUser user = EPUserUtils.getUserSession(request); try {