summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunder Tattavarada <statta@research.att.com>2020-07-07 17:16:42 +0000
committerGerrit Code Review <gerrit@onap.org>2020-07-07 17:16:42 +0000
commitd856cbc5d725836a07776b0f20f06bbbda7b5412 (patch)
treee1eee78b2e15398226ce5e396646150cd0ee224d
parent73cc84364b43eddb1757194a29aec75593d0c764 (diff)
parent3504c843a1322c3a43b9cfe750fdaedfad83c4a8 (diff)
Merge "added annotations"
-rw-r--r--ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/LoginController.java12
-rw-r--r--ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPLoginController.java3
-rw-r--r--ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPWelcomeController.java5
-rw-r--r--ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/AppsOSController.java6
-rw-r--r--ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/DashboardSearchResultController.java17
5 files changed, 26 insertions, 17 deletions
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/LoginController.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/LoginController.java
index 3b0281fb..f88a2547 100644
--- a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/LoginController.java
+++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/LoginController.java
@@ -5,7 +5,7 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ===================================================================
*
- * Unless otherwise specified, all software contained herein is licensed
+ * 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
@@ -16,7 +16,7 @@
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
- * limitations under the License.
+ * limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
* under the Creative Commons License, Attribution 4.0 Intl. (the "License");
@@ -74,6 +74,8 @@ import org.springframework.stereotype.Controller;
import org.springframework.util.StopWatch;
import org.springframework.web.bind.annotation.ExceptionHandler;
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.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
@@ -106,7 +108,7 @@ public class LoginController extends EPUnRestrictedBaseController implements Log
private String welcomeView;
- @RequestMapping(value = { "/login.htm" }, method = RequestMethod.GET)
+ @GetMapping(value = { "/login.htm" })
public ModelAndView login(HttpServletRequest request) {
Map<String, Object> model = new HashMap<String, Object>();
String authentication = SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM);
@@ -119,7 +121,7 @@ public class LoginController extends EPUnRestrictedBaseController implements Log
}
@SuppressWarnings("rawtypes")
- @RequestMapping(value = { "/open_source/login" }, method = RequestMethod.POST)
+ @PostMapping(value = { "/open_source/login" })
@ResponseBody
public String loginValidate(HttpServletRequest request, HttpServletResponse response) throws Exception {
@@ -194,7 +196,7 @@ public class LoginController extends EPUnRestrictedBaseController implements Log
* repaired.
*/
- @RequestMapping(value = { "/processSingleSignOn" }, method = RequestMethod.GET)
+ @GetMapping(value = { "/processSingleSignOn" })
public ModelAndView processSingleSignOn(HttpServletRequest request, HttpServletResponse response) throws Exception {
Map<Object, Object> model = new HashMap<Object, Object>();
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPLoginController.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPLoginController.java
index 98cd790f..9ac20907 100644
--- a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPLoginController.java
+++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPLoginController.java
@@ -50,6 +50,7 @@ import org.onap.portalsdk.core.web.support.AppUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
@@ -70,7 +71,7 @@ public class ONAPLoginController extends UnRestrictedBaseController {
this.loginStrategy = loginStrategy;
}
- @RequestMapping(value = { "/doLogin" }, method = RequestMethod.GET)
+ @GetMapping(value = { "/doLogin" })
public ModelAndView doLogin(HttpServletRequest request, HttpServletResponse response) throws Exception {
return loginStrategy.doLogin(request, response);
}
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPWelcomeController.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPWelcomeController.java
index 08b0da9b..615dff06 100644
--- a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPWelcomeController.java
+++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPWelcomeController.java
@@ -53,6 +53,7 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
@@ -63,12 +64,12 @@ import org.springframework.web.servlet.ModelAndView;
@EPAuditLog
@NoArgsConstructor
public class ONAPWelcomeController extends EPRestrictedBaseController{
- @RequestMapping(value = "/index.htm", method = RequestMethod.GET)
+ @GetMapping(value = "/index.htm")
public String getIndexPage(HttpServletRequest request) {
return "/index";
}
- @RequestMapping(value = {"/app/*","/applicationsHome", "/dashboard", "/widgetsHome", "/kpidash*", "/admins", "/users", "/portalAdmins", "/applications", "/widgets", "/functionalMenu", "/contactUs", "/getAccess","/appCatalog", "/widgetOnboarding", "/accountOnboarding"}, method = RequestMethod.GET)
+ @GetMapping(value = {"/app/*","/applicationsHome", "/dashboard", "/widgetsHome", "/kpidash*", "/admins", "/users", "/portalAdmins", "/applications", "/widgets", "/functionalMenu", "/contactUs", "/getAccess","/appCatalog", "/widgetOnboarding", "/accountOnboarding"})
public String getEcompSinglePage(HttpServletRequest request, HttpServletResponse response) {
return "forward:/index.html";
}
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/AppsOSController.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/AppsOSController.java
index 66237523..a64b0299 100644
--- a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/AppsOSController.java
+++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/AppsOSController.java
@@ -56,6 +56,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.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import lombok.NoArgsConstructor;
@@ -80,7 +82,7 @@ public class AppsOSController extends AppsController {
* @param contactUs
* @return
*/
- @RequestMapping(value = "/portalApi/saveNewUser", method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = "/portalApi/saveNewUser", produces = "application/json")
public PortalRestResponse<String> saveNewUser(HttpServletRequest request, @RequestBody EPUser newUser) {
EPUser user = EPUserUtils.getUserSession(request);
if (newUser == null)
@@ -107,7 +109,7 @@ public class AppsOSController extends AppsController {
return new PortalRestResponse<>(PortalRestStatusEnum.OK, saveNewUser, "");
}
- @RequestMapping(value = { "/portalApi/currentUserProfile/{loginId}" }, method = RequestMethod.GET,
+ @GetMapping(value = { "/portalApi/currentUserProfile/{loginId}" },
produces = "application/json")
public String getCurrentUserProfile(HttpServletRequest request, @PathVariable("loginId") String loginId) {
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<CommonWidgetMeta> 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<String> 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<String> 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<String> 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<Map<String, List<SearchResultItem>>> 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<String> getActiveUsers(HttpServletRequest request) {
List<String> activeUsers = null;
List<String> 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<List<String>> activeUsers(HttpServletRequest request) {
EPUser user = EPUserUtils.getUserSession(request);
try {