Enhancement of NS Instance Creation 50/88850/1 dublin 2.0.1
authorguochuyicmri <guochuyi@chinamobile.com>
Thu, 30 May 2019 09:17:36 +0000 (17:17 +0800)
committerguochuyicmri <guochuyi@chinamobile.com>
Thu, 30 May 2019 09:17:48 +0000 (17:17 +0800)
Change-Id: I6e3fe779df83c31d8b9e09a4209ea8543fdf01c0
Issue-ID: USECASEUI-252
Signed-off-by: guochuyicmri <guochuyi@chinamobile.com>
server/src/main/java/org/onap/usecaseui/server/controller/lcm/ServiceLcmController.java
server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultServiceInstanceService.java

index 68e74ac..28b4b57 100644 (file)
@@ -29,6 +29,7 @@ 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.CrossOrigin;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -42,6 +43,7 @@ import javax.servlet.http.HttpServletRequest;
 @Controller
 @org.springframework.context.annotation.Configuration
 @EnableAspectJAutoProxy
+@CrossOrigin(origins="*")
 public class ServiceLcmController {
 
     private static final Logger logger = LoggerFactory.getLogger(ServiceLcmController.class);
index 6d4cfbb..30f7d2f 100644 (file)
@@ -103,7 +103,6 @@ public class DefaultServiceInstanceService implements ServiceInstanceService {
     }
     
        private List<String> parseServiceInstance(JSONObject objects,String customerId,String serviceType) throws JsonProcessingException{
-       ObjectMapper mapper = new ObjectMapper();
        List<String> result = new ArrayList<>();
        JSONArray serviceInstances=objects.getJSONArray("service-instance");
        for(Object serviceInstance:serviceInstances){
@@ -119,18 +118,7 @@ public class DefaultServiceInstanceService implements ServiceInstanceService {
                                object.put("operationResult",serviceInstanceOperations.getOperationResult());
                                object.put("operationId",serviceInstanceOperations.getOperationId());
                                object.put("operationType",serviceInstanceOperations.getOperationType());
-                               if("SOTN".equals(serviceDomain)||"CCVPN".equals(serviceDomain)||"E2E Service".equals(serviceDomain)||"Network Service".equals(serviceDomain)){
-                                       List<String> parentIds = serviceLcmService.getServiceInstanceIdByParentId(serviceInstanceId);
-                                       List<String> parentServiceInstances = new ArrayList<>();
-                                       if(parentIds.size()>0){
-                                               for(String id:parentIds){
-                                                       String parentServiceInstance=this.getRelationShipData(customerId, serviceType, id);
-                                                       parentServiceInstances.add(parentServiceInstance);
-                                               }
-                                       }
-                                       object.put("childServiceInstances",parentServiceInstances);
-                                       result.add(object.toString());
-                               }
+                               result.add(object.toString());
        }
        return result;
     }