From 9ca350ce747e9f425289acc7113038790b8532e4 Mon Sep 17 00:00:00 2001 From: Rupinder Date: Wed, 6 May 2020 16:19:55 +0530 Subject: put appropriate annotations Issue-ID: SO-2804 Change-Id: I325543a52c13f7bb02c6cf3c30bf9f878617c3c0 Signed-off-by: Rupinder --- .../InfraActiveRequestsRepositoryCustomController.java | 16 ++++++++-------- .../OrchestrationTaskRepositoryCustomController.java | 10 +++++----- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'adapters/mso-requests-db-adapter') diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomController.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomController.java index 28e931a3e1..2adba81f9e 100644 --- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomController.java +++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomController.java @@ -29,6 +29,8 @@ import org.springframework.beans.factory.annotation.Autowired; 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.PostMapping; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -39,27 +41,25 @@ public class InfraActiveRequestsRepositoryCustomController { @Autowired InfraActiveRequestsRepository infraActiveRequestsRepository; - @RequestMapping(method = RequestMethod.POST, - value = "/infraActiveRequests/getCloudOrchestrationFiltersFromInfraActive") + @PostMapping(value = "/infraActiveRequests/getCloudOrchestrationFiltersFromInfraActive") public List getCloudOrchestrationFiltersFromInfraActive( @RequestBody Map orchestrationMap) { return infraActiveRequestsRepository.getCloudOrchestrationFiltersFromInfraActive(orchestrationMap); } - @RequestMapping(method = RequestMethod.POST, value = "/infraActiveRequests/getOrchestrationFiltersFromInfraActive") + @PostMapping(value = "/infraActiveRequests/getOrchestrationFiltersFromInfraActive") public List getOrchestrationFiltersFromInfraActive( @RequestBody Map> orchestrationMap) { return infraActiveRequestsRepository.getOrchestrationFiltersFromInfraActive(orchestrationMap); } - @RequestMapping(method = RequestMethod.GET, - value = "/infraActiveRequests/checkVnfIdStatus/{operationalEnvironmentId}") + @GetMapping(value = "/infraActiveRequests/checkVnfIdStatus/{operationalEnvironmentId}") public InfraActiveRequests checkVnfIdStatus( @PathVariable("operationalEnvironmentId") String operationalEnvironmentId) { return infraActiveRequestsRepository.checkVnfIdStatus(operationalEnvironmentId); } - @RequestMapping(method = RequestMethod.POST, value = "/infraActiveRequests/checkInstanceNameDuplicate") + @PostMapping(value = "/infraActiveRequests/checkInstanceNameDuplicate") public InfraActiveRequests checkInstanceNameDuplicate( @RequestBody InstanceNameDuplicateCheckRequest instanceNameDuplicateCheckRequest) { return infraActiveRequestsRepository.checkInstanceNameDuplicate( @@ -68,14 +68,14 @@ public class InfraActiveRequestsRepositoryCustomController { instanceNameDuplicateCheckRequest.getRequestScope()); } - @RequestMapping(method = RequestMethod.POST, value = "/infraActiveRequests/v1/getInfraActiveRequests") + @PostMapping(value = "/infraActiveRequests/v1/getInfraActiveRequests") public List getInfraActiveRequests(@RequestBody Map filters, @RequestParam("from") long startTime, @RequestParam("to") long endTime, @RequestParam(value = "maxResult", required = false) Integer maxResult) { return infraActiveRequestsRepository.getInfraActiveRequests(filters, startTime, endTime, maxResult); } - @RequestMapping(method = RequestMethod.GET, value = "/infraActiveRequests/getInProgressVolumeGroupsAndVfModules") + @GetMapping(value = "/infraActiveRequests/getInProgressVolumeGroupsAndVfModules") public List getInProgressVolumeGroupsAndVfModules() { return infraActiveRequestsRepository.getInProgressVolumeGroupsAndVfModules(); } diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/OrchestrationTaskRepositoryCustomController.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/OrchestrationTaskRepositoryCustomController.java index e32d90b137..29585b94eb 100644 --- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/OrchestrationTaskRepositoryCustomController.java +++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/OrchestrationTaskRepositoryCustomController.java @@ -33,29 +33,29 @@ public class OrchestrationTaskRepositoryCustomController { @Autowired private OrchestrationTaskRepository orchestrationTaskRepository; - @RequestMapping(method = RequestMethod.GET, value = "/orchestrationTask") + @GetMapping(value = "/orchestrationTask") public List getAllOrchestrationTask() { return orchestrationTaskRepository.findAll(); } - @RequestMapping(method = RequestMethod.GET, value = "/orchestrationTask/{taskId}") + @GetMapping(value = "/orchestrationTask/{taskId}") public OrchestrationTask getOrchestrationTask(@PathVariable("taskId") String taskId) throws MsoRequestsDbException { return orchestrationTaskRepository.findById(taskId) .orElseThrow(() -> new MsoRequestsDbException("orchestration task not found: " + taskId)); } - @RequestMapping(method = RequestMethod.POST, value = "/orchestrationTask/") + @PostMapping(value = "/orchestrationTask/") public OrchestrationTask createOrchestrationTask(@RequestBody OrchestrationTask orchestrationTask) { return orchestrationTaskRepository.save(orchestrationTask); } - @RequestMapping(method = RequestMethod.PUT, value = "/orchestrationTask/{taskId}") + @PutMapping(value = "/orchestrationTask/{taskId}") public OrchestrationTask updateOrchestrationTask(@PathVariable("taskId") String taskId, @RequestBody OrchestrationTask orchestrationTask) throws MsoRequestsDbException { return orchestrationTaskRepository.save(orchestrationTask); } - @RequestMapping(method = RequestMethod.DELETE, value = "/orchestrationTask/{taskId}") + @DeleteMapping(value = "/orchestrationTask/{taskId}") public void deleteOrchestrationTask(@PathVariable("taskId") String taskId) { orchestrationTaskRepository.deleteById(taskId); } -- cgit 1.2.3-korg