diff options
Diffstat (limited to 'ecomp-sdk')
-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); |