diff options
author | xu ran <xuranyjy@chinamobile.com> | 2020-03-20 04:11:16 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-03-20 04:11:16 +0000 |
commit | f3c5de44550a972c18e3bd717c75a43dc882e1ac (patch) | |
tree | 789efda430efbbfaec653e28d07281a23eccb2ed | |
parent | 9a3366d73c84cc6ff2022308316da5df1697df74 (diff) | |
parent | 11084b1ee5fe03ac32a10831626790340b2de26f (diff) |
Merge "Sonar code Smell"
3 files changed, 16 insertions, 21 deletions
diff --git a/server/src/main/java/org/onap/usecaseui/server/controller/csmf/SlicingController.java b/server/src/main/java/org/onap/usecaseui/server/controller/csmf/SlicingController.java index 89ee912d..97226bae 100644 --- a/server/src/main/java/org/onap/usecaseui/server/controller/csmf/SlicingController.java +++ b/server/src/main/java/org/onap/usecaseui/server/controller/csmf/SlicingController.java @@ -22,10 +22,11 @@ import org.onap.usecaseui.server.service.csmf.SlicingService; import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; 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.ResponseBody; @Controller @@ -43,18 +44,16 @@ public class SlicingController { } @ResponseBody - @RequestMapping( + @PostMapping( value = {"/5gSlicing"}, - method = RequestMethod.POST, produces = "application/json") public ServiceResult createSlicingService(@RequestBody SlicingOrder slicingOrder) { return slicingService.createSlicingService(slicingOrder); } @ResponseBody - @RequestMapping( + @GetMapping( value = {"/5gSlicing/orders/status/{status}/pageNo/{pageNo}/pageSize/{pageSize}"}, - method = RequestMethod.GET, produces = "application/json") public ServiceResult querySlicingServiceOrder( @PathVariable(value="status") String status, diff --git a/server/src/main/java/org/onap/usecaseui/server/controller/lcm/ServiceTemplateController.java b/server/src/main/java/org/onap/usecaseui/server/controller/lcm/ServiceTemplateController.java index 7591c396..3a874123 100644 --- a/server/src/main/java/org/onap/usecaseui/server/controller/lcm/ServiceTemplateController.java +++ b/server/src/main/java/org/onap/usecaseui/server/controller/lcm/ServiceTemplateController.java @@ -15,10 +15,11 @@ */ package org.onap.usecaseui.server.controller.lcm; +import java.util.List; +import javax.annotation.Resource; import org.onap.usecaseui.server.bean.lcm.ServiceTemplateInput; -import org.onap.usecaseui.server.bean.lcm.TemplateInput; -import org.onap.usecaseui.server.service.lcm.ServiceTemplateService; import org.onap.usecaseui.server.service.lcm.CustomerService; +import org.onap.usecaseui.server.service.lcm.ServiceTemplateService; import org.onap.usecaseui.server.service.lcm.domain.aai.bean.SDNCController; import org.onap.usecaseui.server.service.lcm.domain.aai.bean.VimInfo; import org.onap.usecaseui.server.service.lcm.domain.sdc.bean.SDCServiceTemplate; @@ -26,11 +27,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; -import java.util.ArrayList; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; @Controller @org.springframework.context.annotation.Configuration @@ -50,26 +50,26 @@ public class ServiceTemplateController { } @ResponseBody - @RequestMapping(value = {"/uui-lcm/service-templates"}, method = RequestMethod.GET , produces = "application/json") + @GetMapping(value = {"/uui-lcm/service-templates"} , produces = "application/json") public List<SDCServiceTemplate> getServiceTemplates(){ return serviceTemplateService.listDistributedServiceTemplate(); } @ResponseBody - @RequestMapping(value = {"/uui-lcm/service-templates/{uuid}"}, method = RequestMethod.GET , produces = "application/json") + @GetMapping(value = {"/uui-lcm/service-templates/{uuid}"}, produces = "application/json") public ServiceTemplateInput getServiceTemplateInput(@PathVariable("uuid") String uuid, @RequestParam("toscaModelPath") String toscaModelPath){ ServiceTemplateInput serviceTemplateInput = serviceTemplateService.fetchServiceTemplateInput(uuid, "/api"+toscaModelPath); return serviceTemplateInput; } @ResponseBody - @RequestMapping(value = {"/uui-lcm/locations/"}, method = RequestMethod.GET , produces = "application/json") + @GetMapping(value = {"/uui-lcm/locations/"}, produces = "application/json") public List<VimInfo> getLocations(){ return serviceTemplateService.listVim(); } @ResponseBody - @RequestMapping(value = {"/uui-lcm/getAllNI/{networkId}"}, method = RequestMethod.GET , produces = "application/json") + @GetMapping(value = {"/uui-lcm/getAllNI/{networkId}"}, produces = "application/json") public List<String> getAllNetworkInterface(@PathVariable("networkId") String networkId){ List<String> nIList = customerService.fetchNIList(networkId); @@ -77,7 +77,7 @@ public class ServiceTemplateController { } @ResponseBody - @RequestMapping(value = {"/uui-lcm/sdnc-controllers/"}, method = RequestMethod.GET , produces = "application/json") + @GetMapping(value = {"/uui-lcm/sdnc-controllers/"}, produces = "application/json") public List<SDNCController> getSDNCControllers(){ return serviceTemplateService.listSDNCControllers(); } diff --git a/server/src/main/java/org/onap/usecaseui/server/service/customer/CcvpnCustomerService.java b/server/src/main/java/org/onap/usecaseui/server/service/customer/CcvpnCustomerService.java index ca1e9f7c..02e85823 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/customer/CcvpnCustomerService.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/customer/CcvpnCustomerService.java @@ -15,15 +15,11 @@ */ package org.onap.usecaseui.server.service.customer; -import org.onap.usecaseui.server.bean.customer.ServiceInstance; import org.onap.usecaseui.server.bean.customer.ServiceInstances; -import java.util.List; - public interface CcvpnCustomerService { public ServiceInstances getServiceInstances(String customerId, String serviceType); - //public String getServiceInformation(String serviceInstanceId) throws Exception; public String querySubscriptionType(String customerId); } |