Skip to content

Commit

Permalink
Merge pull request #122 from catenax-ng/fix/pool_client_annotations
Browse files Browse the repository at this point in the history
Fix pool client annotations
  • Loading branch information
nicoprow authored May 4, 2023
2 parents d0ce7de + eb0175d commit d85595c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ import io.swagger.v3.oas.annotations.Parameter
import io.swagger.v3.oas.annotations.media.Content
import io.swagger.v3.oas.annotations.responses.ApiResponse
import io.swagger.v3.oas.annotations.responses.ApiResponses
import org.eclipse.tractusx.bpdm.common.dto.response.PageResponse
import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest
import org.eclipse.tractusx.bpdm.common.dto.response.PageResponse
import org.eclipse.tractusx.bpdm.pool.api.model.response.ChangelogEntryResponse
import org.springdoc.core.annotations.ParameterObject
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.service.annotation.GetExchange
import org.springframework.web.service.annotation.HttpExchange
import java.time.Instant
Expand All @@ -54,8 +55,8 @@ interface PoolBusinessPartnerApi {
@GetMapping("/changelog")
@GetExchange("/changelog")
fun getChangelogEntries(
@Parameter(description = "BPN values") bpn: Array<String>?,
@Parameter(description = "Modified after") modifiedAfter: Instant?,
@Parameter(description = "BPN values") @RequestParam(required = false) bpn: Array<String>?,
@Parameter(description = "Modified after") @RequestParam(required = false) modifiedAfter: Instant?,
@ParameterObject paginationRequest: PaginationRequest
): PageResponse<ChangelogEntryResponse>
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@ package org.eclipse.tractusx.bpdm.pool.api
import io.swagger.v3.oas.annotations.Operation
import io.swagger.v3.oas.annotations.Parameter
import io.swagger.v3.oas.annotations.responses.ApiResponse
import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest
import org.eclipse.tractusx.bpdm.common.dto.response.PageResponse
import org.eclipse.tractusx.bpdm.pool.api.model.request.AddressPropertiesSearchRequest
import org.eclipse.tractusx.bpdm.pool.api.model.request.LegalEntityPropertiesSearchRequest
import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest
import org.eclipse.tractusx.bpdm.pool.api.model.request.SitePropertiesSearchRequest
import org.eclipse.tractusx.bpdm.pool.api.model.response.SuggestionResponse
import org.springdoc.core.annotations.ParameterObject
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.service.annotation.GetExchange
import org.springframework.web.service.annotation.HttpExchange

Expand All @@ -48,7 +49,7 @@ interface PoolSuggestionApi {
@GetMapping("legal-entities/names")
@GetExchange("legal-entities/names")
fun getNameSuggestion(
@Parameter(description = "Show names best matching this text") text: String?,
@Parameter(description = "Show names best matching this text") @RequestParam(required = false) text: String?,
@ParameterObject bpSearchRequest: LegalEntityPropertiesSearchRequest,
@ParameterObject addressSearchRequest: AddressPropertiesSearchRequest,
@ParameterObject siteSearchRequest: SitePropertiesSearchRequest,
Expand All @@ -65,7 +66,7 @@ interface PoolSuggestionApi {
@GetMapping("legal-entities/legal-forms")
@GetExchange("legal-entities/legal-forms")
fun getLegalFormSuggestion(
@Parameter(description = "Show legal form names best matching this text") text: String?,
@Parameter(description = "Show legal form names best matching this text") @RequestParam(required = false) text: String?,
@ParameterObject bpSearchRequest: LegalEntityPropertiesSearchRequest,
@ParameterObject addressSearchRequest: AddressPropertiesSearchRequest,
@ParameterObject siteSearchRequest: SitePropertiesSearchRequest,
Expand All @@ -82,7 +83,7 @@ interface PoolSuggestionApi {
@GetMapping("sites/names")
@GetExchange("sites/names")
fun getSiteSuggestion(
@Parameter(description = "Show site names best matching this text") text: String?,
@Parameter(description = "Show site names best matching this text") @RequestParam(required = false) text: String?,
@ParameterObject bpSearchRequest: LegalEntityPropertiesSearchRequest,
@ParameterObject addressSearchRequest: AddressPropertiesSearchRequest,
@ParameterObject siteSearchRequest: SitePropertiesSearchRequest,
Expand All @@ -99,7 +100,7 @@ interface PoolSuggestionApi {
@GetMapping("legal-entities/statuses")
@GetExchange("legal-entities/statuses")
fun getStatusSuggestion(
@Parameter(description = "Show business status denotations best matching this text") text: String?,
@Parameter(description = "Show business status denotations best matching this text") @RequestParam(required = false) text: String?,
@ParameterObject bpSearchRequest: LegalEntityPropertiesSearchRequest,
@ParameterObject addressSearchRequest: AddressPropertiesSearchRequest,
@ParameterObject siteSearchRequest: SitePropertiesSearchRequest,
Expand All @@ -116,7 +117,7 @@ interface PoolSuggestionApi {
@GetMapping("legal-entities/classifications")
@GetExchange("legal-entities/classifications")
fun getClassificationSuggestion(
@Parameter(description = "Show business partner classifications best matching this text") text: String?,
@Parameter(description = "Show business partner classifications best matching this text") @RequestParam(required = false) text: String?,
@ParameterObject bpSearchRequest: LegalEntityPropertiesSearchRequest,
@ParameterObject addressSearchRequest: AddressPropertiesSearchRequest,
@ParameterObject siteSearchRequest: SitePropertiesSearchRequest,
Expand All @@ -132,7 +133,7 @@ interface PoolSuggestionApi {
@GetMapping("/addresses/administrative-areas")
@GetExchange("/addresses/administrative-areas")
fun getAdminAreaSuggestion(
@Parameter(description = "Show administrative area names best matching this text") text: String?,
@Parameter(description = "Show administrative area names best matching this text") @RequestParam(required = false) text: String?,
@ParameterObject bpSearchRequest: LegalEntityPropertiesSearchRequest,
@ParameterObject addressSearchRequest: AddressPropertiesSearchRequest,
@ParameterObject siteSearchRequest: SitePropertiesSearchRequest,
Expand All @@ -149,7 +150,7 @@ interface PoolSuggestionApi {
@GetMapping("/addresses/postcodes")
@GetExchange("/addresses/postcodes")
fun getPostcodeSuggestion(
@Parameter(description = "Show postcodes best matching this text") text: String?,
@Parameter(description = "Show postcodes best matching this text") @RequestParam(required = false) text: String?,
@ParameterObject bpSearchRequest: LegalEntityPropertiesSearchRequest,
@ParameterObject addressSearchRequest: AddressPropertiesSearchRequest,
@ParameterObject siteSearchRequest: SitePropertiesSearchRequest,
Expand All @@ -166,7 +167,7 @@ interface PoolSuggestionApi {
@GetMapping("/addresses/localities")
@GetExchange("/addresses/localities")
fun getLocalitySuggestion(
@Parameter(description = "Show locality names this text") text: String?,
@Parameter(description = "Show locality names this text") @RequestParam(required = false) text: String?,
@ParameterObject bpSearchRequest: LegalEntityPropertiesSearchRequest,
@ParameterObject addressSearchRequest: AddressPropertiesSearchRequest,
@ParameterObject siteSearchRequest: SitePropertiesSearchRequest,
Expand All @@ -183,7 +184,7 @@ interface PoolSuggestionApi {
@GetMapping("/addresses/thoroughfares")
@GetExchange("/addresses/thoroughfares")
fun getThoroughfareSuggestion(
@Parameter(description = "Show thoroughfare names best matching this text") text: String?,
@Parameter(description = "Show thoroughfare names best matching this text") @RequestParam(required = false) text: String?,
@ParameterObject bpSearchRequest: LegalEntityPropertiesSearchRequest,
@ParameterObject addressSearchRequest: AddressPropertiesSearchRequest,
@ParameterObject siteSearchRequest: SitePropertiesSearchRequest,
Expand All @@ -200,7 +201,7 @@ interface PoolSuggestionApi {
@GetMapping("/addresses/premises")
@GetExchange("/addresses/premises")
fun getPremiseSuggestion(
@Parameter(description = "Show premise names best matching this text") text: String?,
@Parameter(description = "Show premise names best matching this text") @RequestParam(required = false) text: String?,
@ParameterObject bpSearchRequest: LegalEntityPropertiesSearchRequest,
@ParameterObject addressSearchRequest: AddressPropertiesSearchRequest,
@ParameterObject siteSearchRequest: SitePropertiesSearchRequest,
Expand All @@ -217,7 +218,7 @@ interface PoolSuggestionApi {
@GetMapping("/addresses/postal-delivery-points")
@GetExchange("/addresses/postal-delivery-points")
fun getPostalDeliverPointSuggestion(
@Parameter(description = "Show postal delivery point names best matching this text") text: String?,
@Parameter(description = "Show postal delivery point names best matching this text") @RequestParam(required = false) text: String?,
@ParameterObject bpSearchRequest: LegalEntityPropertiesSearchRequest,
@ParameterObject addressSearchRequest: AddressPropertiesSearchRequest,
@ParameterObject siteSearchRequest: SitePropertiesSearchRequest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,12 @@ class PoolClientImpl(
.builder(WebClientAdapter.forClient(webClientProvider()))
.customArgumentResolver(ParameterObjectArgumentResolver())
.build()

}


private val poolClientAddress by lazy { httpServiceProxyFactory.createClient(PoolAddressApi::class.java) }
private val poolClientBpn by lazy { httpServiceProxyFactory.createClient(PoolBpnApi::class.java) }
private val oolClientBusinessPartner by lazy { httpServiceProxyFactory.createClient(PoolBusinessPartnerApi::class.java) }
private val poolClientBusinessPartner by lazy { httpServiceProxyFactory.createClient(PoolBusinessPartnerApi::class.java) }
private val poolClientLegalEntity by lazy { httpServiceProxyFactory.createClient(PoolLegalEntityApi::class.java) }
private val poolClientMetadata by lazy { httpServiceProxyFactory.createClient(PoolMetadataApi::class.java) }
private val poolClientSite by lazy { httpServiceProxyFactory.createClient(PoolSiteApi::class.java) }
Expand All @@ -53,7 +52,7 @@ class PoolClientImpl(

override fun bpns() = poolClientBpn

override fun businessPartners() = oolClientBusinessPartner
override fun businessPartners() = poolClientBusinessPartner

override fun legalEntities() = poolClientLegalEntity

Expand Down

0 comments on commit d85595c

Please sign in to comment.