From 0048650ca2e3e44fd6c40128d3b00c87a9c02280 Mon Sep 17 00:00:00 2001 From: Nico Koprowski Date: Thu, 26 Oct 2023 10:47:37 +0200 Subject: [PATCH] refactor(Gate): move Extensions.kt to a util package --- .../tractusx/bpdm/gate/controller/AddressController.kt | 2 +- .../bpdm/gate/controller/BusinessPartnerController.kt | 2 +- .../tractusx/bpdm/gate/controller/LegalEntityController.kt | 7 +------ .../tractusx/bpdm/gate/controller/SiteController.kt | 2 +- .../eclipse/tractusx/bpdm/gate/{ => util}/Extensions.kt | 2 +- 5 files changed, 5 insertions(+), 10 deletions(-) rename bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/{ => util}/Extensions.kt (96%) diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/AddressController.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/AddressController.kt index 36e408b3d..b509fb587 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/AddressController.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/AddressController.kt @@ -27,8 +27,8 @@ import org.eclipse.tractusx.bpdm.gate.api.model.request.AddressGateOutputRequest import org.eclipse.tractusx.bpdm.gate.api.model.response.AddressGateInputDto import org.eclipse.tractusx.bpdm.gate.api.model.response.AddressGateOutputDto import org.eclipse.tractusx.bpdm.gate.config.ApiConfigProperties -import org.eclipse.tractusx.bpdm.gate.containsDuplicates import org.eclipse.tractusx.bpdm.gate.service.AddressService +import org.eclipse.tractusx.bpdm.gate.util.containsDuplicates import org.springframework.http.HttpStatus import org.springframework.http.ResponseEntity import org.springframework.security.access.prepost.PreAuthorize diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/BusinessPartnerController.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/BusinessPartnerController.kt index 7e3708ff9..50cd47e21 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/BusinessPartnerController.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/BusinessPartnerController.kt @@ -27,8 +27,8 @@ import org.eclipse.tractusx.bpdm.gate.api.model.request.BusinessPartnerInputRequ import org.eclipse.tractusx.bpdm.gate.api.model.response.BusinessPartnerInputDto import org.eclipse.tractusx.bpdm.gate.api.model.response.BusinessPartnerOutputDto import org.eclipse.tractusx.bpdm.gate.config.ApiConfigProperties -import org.eclipse.tractusx.bpdm.gate.containsDuplicates import org.eclipse.tractusx.bpdm.gate.service.BusinessPartnerService +import org.eclipse.tractusx.bpdm.gate.util.containsDuplicates import org.springframework.http.HttpStatus import org.springframework.http.ResponseEntity import org.springframework.security.access.prepost.PreAuthorize diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/LegalEntityController.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/LegalEntityController.kt index ef8827399..97a4154a8 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/LegalEntityController.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/LegalEntityController.kt @@ -19,9 +19,6 @@ package org.eclipse.tractusx.bpdm.gate.controller -import io.swagger.v3.oas.annotations.Operation -import io.swagger.v3.oas.annotations.responses.ApiResponse -import io.swagger.v3.oas.annotations.responses.ApiResponses import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest import org.eclipse.tractusx.bpdm.common.dto.response.PageDto import org.eclipse.tractusx.bpdm.gate.api.GateLegalEntityApi @@ -30,13 +27,11 @@ import org.eclipse.tractusx.bpdm.gate.api.model.request.LegalEntityGateOutputReq import org.eclipse.tractusx.bpdm.gate.api.model.response.LegalEntityGateInputDto import org.eclipse.tractusx.bpdm.gate.api.model.response.LegalEntityGateOutputResponse import org.eclipse.tractusx.bpdm.gate.config.ApiConfigProperties -import org.eclipse.tractusx.bpdm.gate.containsDuplicates import org.eclipse.tractusx.bpdm.gate.service.LegalEntityService +import org.eclipse.tractusx.bpdm.gate.util.containsDuplicates import org.springframework.http.HttpStatus -import org.springframework.http.MediaType import org.springframework.http.ResponseEntity import org.springframework.security.access.prepost.PreAuthorize -import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.RestController @RestController diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/SiteController.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/SiteController.kt index 39b06dc36..cbb04ce7f 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/SiteController.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/SiteController.kt @@ -27,8 +27,8 @@ import org.eclipse.tractusx.bpdm.gate.api.model.request.SiteGateOutputRequest import org.eclipse.tractusx.bpdm.gate.api.model.response.SiteGateInputDto import org.eclipse.tractusx.bpdm.gate.api.model.response.SiteGateOutputResponse import org.eclipse.tractusx.bpdm.gate.config.ApiConfigProperties -import org.eclipse.tractusx.bpdm.gate.containsDuplicates import org.eclipse.tractusx.bpdm.gate.service.SiteService +import org.eclipse.tractusx.bpdm.gate.util.containsDuplicates import org.springframework.http.HttpStatus import org.springframework.http.ResponseEntity import org.springframework.security.access.prepost.PreAuthorize diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/Extensions.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/util/Extensions.kt similarity index 96% rename from bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/Extensions.kt rename to bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/util/Extensions.kt index 23337197b..765a9eb19 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/Extensions.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/util/Extensions.kt @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.gate +package org.eclipse.tractusx.bpdm.gate.util fun List.containsDuplicates(): Boolean = size != distinct().size