diff options
author | 2022-03-14 09:47:27 +0000 | |
---|---|---|
committer | 2022-03-14 09:47:27 +0000 | |
commit | 7c98a26620b424d7328b57e0aeedd634cdeeb564 (patch) | |
tree | 7db788a85821dfa84a220410986d7f82ceb7cd97 /cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java | |
parent | 697caa85dd35d5996d604935987e43b61b5811c2 (diff) | |
parent | d5bda8848a661465f214b0bf11211e63b272cfd6 (diff) |
Merge "Replacing ModelMapper with MapStruct"
Diffstat (limited to 'cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java')
-rwxr-xr-x | cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java index b5c8d14a9..0201fad2b 100755 --- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java +++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java @@ -37,7 +37,6 @@ import javax.validation.Valid; import javax.validation.constraints.NotNull; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.modelmapper.ModelMapper; import org.onap.cps.ncmp.api.NetworkCmProxyDataService; import org.onap.cps.ncmp.api.models.NcmpServiceCmHandle; import org.onap.cps.ncmp.rest.api.NetworkCmProxyApi; @@ -49,7 +48,7 @@ import org.onap.cps.ncmp.rest.model.ConditionProperties; import org.onap.cps.ncmp.rest.model.Conditions; import org.onap.cps.ncmp.rest.model.ModuleNameAsJsonObject; import org.onap.cps.ncmp.rest.model.ModuleNamesAsJsonArray; -import org.onap.cps.ncmp.rest.model.ModuleReference; +import org.onap.cps.ncmp.rest.model.RestModuleReference; import org.onap.cps.ncmp.rest.model.RestOutputCmHandle; import org.onap.cps.utils.JsonObjectMapper; import org.springframework.http.HttpStatus; @@ -65,9 +64,9 @@ public class NetworkCmProxyController implements NetworkCmProxyApi { private static final String NO_BODY = null; - private final ModelMapper modelMapper; private final NetworkCmProxyDataService networkCmProxyDataService; private final JsonObjectMapper jsonObjectMapper; + private final NcmpRestInputMapper ncmpRestInputMapper; /** * Get resource data from operational datastore. @@ -213,12 +212,12 @@ public class NetworkCmProxyController implements NetworkCmProxyApi { * @param cmHandle the cm handle * @return module references for cm handle. Namespace will be always blank because restConf does not include this. */ - public ResponseEntity<List<ModuleReference>> getModuleReferencesByCmHandle(final String cmHandle) { - final List<ModuleReference> moduleReferences = + public ResponseEntity<List<RestModuleReference>> getModuleReferencesByCmHandle(final String cmHandle) { + final List<RestModuleReference> restModuleReferences = networkCmProxyDataService.getYangResourcesModuleReferences(cmHandle).stream() - .map(moduleReference -> modelMapper.map(moduleReference, ModuleReference.class)) + .map(ncmpRestInputMapper::toRestModuleReference) .collect(Collectors.toList()); - return new ResponseEntity<>(moduleReferences, HttpStatus.OK); + return new ResponseEntity<>(restModuleReferences, HttpStatus.OK); } private Collection<String> processConditions(final List<ConditionProperties> conditionProperties) { |