diff options
author | 2020-06-12 11:06:38 +0530 | |
---|---|---|
committer | 2020-06-12 11:06:44 +0530 | |
commit | bf1dd84c77dc7f252f8116fce5142356baa15573 (patch) | |
tree | 08f367248778fbca9a38dad2b316e1936cd4d492 /ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk | |
parent | 88a56a8071697d2a7dfa7db7e32c8a496218fb70 (diff) |
replaced the annotations
Issue-ID: PORTAL-865
Change-Id: Id57250d5b2a73f7533b91d7b794aa7b72ca50cd1
Signed-off-by: Rupinder <rupinsi1@in.ibm.com>
Diffstat (limited to 'ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk')
-rw-r--r-- | ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/controllers/WorkflowController.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/controllers/WorkflowController.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/controllers/WorkflowController.java index 5aa556d1..19c7ea50 100644 --- a/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/controllers/WorkflowController.java +++ b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/controllers/WorkflowController.java @@ -58,7 +58,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; 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.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; @@ -78,7 +80,7 @@ public class WorkflowController extends RestrictedBaseController { @Autowired private WorkflowService workflowService; - @RequestMapping(value = { "workflows/saveCronJob" }, method = RequestMethod.POST) + @PostMapping(value = { "workflows/saveCronJob" }) public void saveCronJob(HttpServletRequest request, HttpServletResponse response) throws Exception { try { @@ -108,7 +110,7 @@ public class WorkflowController extends RestrictedBaseController { } - @RequestMapping(value = { "workflows/list" }, method = RequestMethod.GET, produces = "application/json") + @GetMapping(value = { "workflows/list" }, produces = "application/json") @ResponseBody public String getWorkflowList() { ObjectMapper mapper = new ObjectMapper(); @@ -142,21 +144,21 @@ public class WorkflowController extends RestrictedBaseController { return ""; } - @RequestMapping(value = "workflows/addWorkflow", method = RequestMethod.POST, consumes = "application/json") + @PostMapping(value = "workflows/addWorkflow", consumes = "application/json") @ResponseBody public Workflow addWorkflow(@RequestBody Workflow workflow, HttpServletRequest request) { String loginId = ((User) (request.getSession().getAttribute("user"))).getLoginId(); return workflowService.addWorkflow(workflow, loginId); } - @RequestMapping(value = "workflows/editWorkflow", method = RequestMethod.POST, consumes = "application/json") + @PostMapping(value = "workflows/editWorkflow", consumes = "application/json") @ResponseBody public Workflow editWorkflow(@RequestBody WorkflowLite workflow, HttpServletRequest request) { String loginId = ((User) (request.getSession().getAttribute("user"))).getLoginId(); return workflowService.editWorkflow(workflow, loginId); } - @RequestMapping(value = { "workflows/removeWorkflow" }, method = RequestMethod.POST, consumes = "application/json") + @PostMapping(value = { "workflows/removeWorkflow" }, consumes = "application/json") @ResponseBody public String removeWorkflow(@RequestBody Long workflowId, HttpServletRequest request, HttpServletResponse response) { workflowService.deleteWorkflow(workflowId); @@ -165,13 +167,13 @@ public class WorkflowController extends RestrictedBaseController { return "{removed: 123}"; } - @RequestMapping(value = "workflows/removeAllWorkflows", method = RequestMethod.DELETE) + @DeleteMapping(value = "workflows/removeAllWorkflows") @ResponseBody public void removeAllWorkflows() { throw new UnsupportedOperationException(); } - @RequestMapping(value = { "/workflows" }, method = RequestMethod.GET) + @GetMapping(value = { "/workflows" }) public ModelAndView getWorkflowPartialPage() { Map<String, Object> model = new HashMap<>(); return new ModelAndView(getViewName(), "workflows", model); |