added appropriate annotations 48/106248/2
authorRupinder <rupinsi1@in.ibm.com>
Mon, 20 Apr 2020 08:10:31 +0000 (13:40 +0530)
committerRupinderjeet Singh <rupinsi1@in.ibm.com>
Mon, 20 Apr 2020 08:38:42 +0000 (08:38 +0000)
Issue-ID: PORTAL-865
Change-Id: If5cc90f8f20fac8adb93b08691b08a8a4ae33152
Signed-off-by: Rupinder<rupinsi1@in.ibm.com>
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/controller/sessionmgt/SessionCommunicationController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppCatalogController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppContactUsController.java

index d36cf6c..33006c9 100644 (file)
@@ -54,6 +54,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
 
 import io.swagger.annotations.ApiOperation;
 
@@ -75,14 +77,14 @@ public class SessionCommunicationController  extends EPRestrictedRESTfulBaseCont
        
        @ApiOperation(value = "Gets session slot-check interval, a duration in milliseconds.",
     response = Integer.class)
-       @RequestMapping(value={"/getSessionSlotCheckInterval"}, method = RequestMethod.GET, produces = "application/json")
+       @GetMapping(value={"/getSessionSlotCheckInterval"}, produces = "application/json")
        public Integer getSessionSlotCheckInterval(HttpServletRequest request, HttpServletResponse response) throws Exception {
                return manageService.fetchSessionSlotCheckInterval();
        }
        
        @ApiOperation(value = "Extends session timeout values for all on-boarded applications.",
     response = Boolean.class)
-       @RequestMapping(value={"/extendSessionTimeOuts"}, method = RequestMethod.POST)
+       @PostMapping(value={"/extendSessionTimeOuts"})
        public Boolean extendSessionTimeOuts(HttpServletRequest request, HttpServletResponse response, @RequestParam String sessionMap) {
                manageService.extendSessionTimeOuts(sessionMap);
                
index 557e4dc..6ff16fc 100644 (file)
@@ -62,6 +62,9 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+
 
 @RestController
 @org.springframework.context.annotation.Configuration
@@ -90,7 +93,7 @@ public class AppCatalogController extends EPRestrictedBaseController {
         * @throws IOException If sendError fails
         * @return List of items suitable for display
         */
-       @RequestMapping(value = { "/portalApi/appCatalog" }, method = RequestMethod.GET, produces = "application/json")
+       @GetMapping(value = { "/portalApi/appCatalog" }, produces = "application/json")
        public List<AppCatalogItem> getAppCatalog(HttpServletRequest request, HttpServletResponse response)
                        throws IOException {
                EPUser user = EPUserUtils.getUserSession(request);
@@ -125,7 +128,7 @@ public class AppCatalogController extends EPRestrictedBaseController {
         * @return FieldsValidator
         * @throws IOException If sendError fails
         */
-       @RequestMapping(value = { "/portalApi/appCatalog" }, method = RequestMethod.PUT, produces = "application/json")
+       @PutMapping(value = { "/portalApi/appCatalog" }, produces = "application/json")
        public FieldsValidator putAppCatalogSelection(HttpServletRequest request,
                        @RequestBody AppCatalogPersonalization persRequest, HttpServletResponse response) throws IOException {
                FieldsValidator result = new FieldsValidator();
index 8f456fd..e9119de 100644 (file)
@@ -63,6 +63,8 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
 
 @RestController
 @RequestMapping("/portalApi/contactus")
@@ -94,7 +96,7 @@ public class AppContactUsController extends EPRestrictedBaseController {
         * @param request HttpServletRequest
         * @return PortalRestResponse
         */
-       @RequestMapping(value = "/feedback", method = RequestMethod.GET, produces = "application/json")
+       @GetMapping(value = "/feedback", produces = "application/json")
        public PortalRestResponse<String> getPortalDetails(HttpServletRequest request) {
                PortalRestResponse<String> portalRestResponse;
                try {
@@ -123,7 +125,7 @@ public class AppContactUsController extends EPRestrictedBaseController {
         * @param request HttpServletRequest
         * @return PortalRestResponse<List<AppContactUsItem>>
         */
-       @RequestMapping(value = "/list", method = RequestMethod.GET, produces = "application/json")
+       @GetMapping(value = "/list", produces = "application/json")
        public PortalRestResponse<List<AppContactUsItem>> getAppContactUsList(HttpServletRequest request) {
                PortalRestResponse<List<AppContactUsItem>> portalRestResponse;
                try {
@@ -145,7 +147,7 @@ public class AppContactUsController extends EPRestrictedBaseController {
         * @param request HttpServletRequest
         * @return PortalRestResponse<List<AppContactUsItem>>
         */
-       @RequestMapping(value = "/allapps", method = RequestMethod.GET, produces = "application/json")
+       @GetMapping(value = "/allapps", produces = "application/json")
        public PortalRestResponse<List<AppContactUsItem>> getAppsAndContacts(HttpServletRequest request) {
                PortalRestResponse<List<AppContactUsItem>> portalRestResponse;
                try {
@@ -167,7 +169,7 @@ public class AppContactUsController extends EPRestrictedBaseController {
         * @param request HttpServletRequest
         * @return PortalRestResponse<List<AppCategoryFunctionsItem>>
         */
-       @RequestMapping(value = "/functions", method = RequestMethod.GET, produces = "application/json")
+       @GetMapping(value = "/functions", produces = "application/json")
        public PortalRestResponse<List<AppCategoryFunctionsItem>> getAppCategoryFunctions(HttpServletRequest request) {
                PortalRestResponse<List<AppCategoryFunctionsItem>> portalRestResponse;
                try {
@@ -190,7 +192,7 @@ public class AppContactUsController extends EPRestrictedBaseController {
         * @param contactUs AppContactUsItem
         * @return PortalRestResponse<String>
         */
-       @RequestMapping(value = "/save", method = RequestMethod.POST, produces = "application/json")
+       @PostMapping(value = "/save", produces = "application/json")
        public PortalRestResponse<String> save(@RequestBody AppContactUsItem contactUs) {
 
                if (contactUs == null || contactUs.getAppName() == null) {
@@ -210,7 +212,7 @@ public class AppContactUsController extends EPRestrictedBaseController {
                return new PortalRestResponse<>(PortalRestStatusEnum.OK, saveAppContactUs, "");
        }
 
-       @RequestMapping(value = "/saveAll", method = RequestMethod.POST, produces = "application/json")
+       @PostMapping(value = "/saveAll", produces = "application/json")
        public PortalRestResponse<String> save(@RequestBody List<AppContactUsItem> contactUsList) {
 
                if (contactUsList == null) {
@@ -237,7 +239,7 @@ public class AppContactUsController extends EPRestrictedBaseController {
         * @param id app ID
         * @return PortalRestResponse<String>
         */
-       @RequestMapping(value = "/delete/{appid}", method = RequestMethod.POST, produces = "application/json")
+       @PostMapping(value = "/delete/{appid}", produces = "application/json")
        public PortalRestResponse<String> delete(@PathVariable("appid") Long id) {
 
                String saveAppContactUs = FAILURE;