Skip to content

Commit

Permalink
fix(pool-api): Add @RequestParam annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
martinfkaeser committed May 4, 2023
1 parent c6cce83 commit d87576a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 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

0 comments on commit d87576a

Please sign in to comment.