From fd0a48953f789c566ab6765013bf7c55579a0809 Mon Sep 17 00:00:00 2001 From: gianmarcoplutino Date: Wed, 6 Nov 2024 12:22:44 +0100 Subject: [PATCH 1/2] feat: added tag internal-v1 to PDND-infocamere --- app/src/main/resources/swagger/api-docs.json | 2 +- .../controller/PDNDInfoCamereController.java | 55 +++++++++++-------- 2 files changed, 32 insertions(+), 25 deletions(-) diff --git a/app/src/main/resources/swagger/api-docs.json b/app/src/main/resources/swagger/api-docs.json index 22b48f3d..cca9f61a 100644 --- a/app/src/main/resources/swagger/api-docs.json +++ b/app/src/main/resources/swagger/api-docs.json @@ -1143,7 +1143,7 @@ }, "/infocamere-pdnd/institution/{taxCode}" : { "get" : { - "tags" : [ "infocamere PDND" ], + "tags" : [ "internal-v1" ], "summary" : "Get institution by institution taxCode", "description" : "Get the company represented by taxCode of the institution passed as a parameter", "operationId" : "institutionPdndByTaxCodeUsingGET", diff --git a/web/src/main/java/it/pagopa/selfcare/party/registry_proxy/web/controller/PDNDInfoCamereController.java b/web/src/main/java/it/pagopa/selfcare/party/registry_proxy/web/controller/PDNDInfoCamereController.java index 5a9826d6..11e65ccc 100644 --- a/web/src/main/java/it/pagopa/selfcare/party/registry_proxy/web/controller/PDNDInfoCamereController.java +++ b/web/src/main/java/it/pagopa/selfcare/party/registry_proxy/web/controller/PDNDInfoCamereController.java @@ -3,6 +3,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; +import io.swagger.v3.oas.annotations.tags.Tag; import it.pagopa.selfcare.party.registry_proxy.connector.model.nationalregistriespdnd.PDNDBusiness; import it.pagopa.selfcare.party.registry_proxy.core.PDNDInfoCamereService; import it.pagopa.selfcare.party.registry_proxy.web.model.PDNDBusinessResource; @@ -21,31 +22,37 @@ @Api(tags = "infocamere PDND") public class PDNDInfoCamereController { - private final PDNDInfoCamereService pdndInfoCamereService; - private final PDNDInfoCamereBusinessMapper pdndBusinessMapper; + private final PDNDInfoCamereService pdndInfoCamereService; + private final PDNDInfoCamereBusinessMapper pdndBusinessMapper; - public PDNDInfoCamereController(PDNDInfoCamereService pdndInfoCamereService, PDNDInfoCamereBusinessMapper pdndBusinessMapper) { - this.pdndInfoCamereService = pdndInfoCamereService; - this.pdndBusinessMapper = pdndBusinessMapper; - } + public PDNDInfoCamereController( + PDNDInfoCamereService pdndInfoCamereService, + PDNDInfoCamereBusinessMapper pdndBusinessMapper) { + this.pdndInfoCamereService = pdndInfoCamereService; + this.pdndBusinessMapper = pdndBusinessMapper; + } - @ResponseStatus(HttpStatus.OK) - @ApiOperation(value = "${swagger.api.infocamere-pdnd.institutions.summary}", - notes = "${swagger.api.infocamere-pdnd.institutions.notes}") - @GetMapping("/institutions") - public ResponseEntity> institutionsPdndByDescription(@ApiParam("${swagger.model.institution.description}") - @RequestParam String description) { - List businessList = pdndInfoCamereService.retrieveInstitutionsPdndByDescription(description); - return ResponseEntity.ok().body(pdndBusinessMapper.toResources(businessList)); - } + @ResponseStatus(HttpStatus.OK) + @ApiOperation( + value = "${swagger.api.infocamere-pdnd.institutions.summary}", + notes = "${swagger.api.infocamere-pdnd.institutions.notes}") + @GetMapping("/institutions") + public ResponseEntity> institutionsPdndByDescription( + @ApiParam("${swagger.model.institution.description}") @RequestParam String description) { + List businessList = + pdndInfoCamereService.retrieveInstitutionsPdndByDescription(description); + return ResponseEntity.ok().body(pdndBusinessMapper.toResources(businessList)); + } - @ResponseStatus(HttpStatus.OK) - @ApiOperation(value = "${swagger.api.infocamere-pdnd.institution.summary}", - notes = "${swagger.api.infocamere-pdnd.institution.notes}") - @GetMapping("/institution/{taxCode}") - public ResponseEntity institutionPdndByTaxCode(@ApiParam("${swagger.model.institution.taxCode}") - @PathVariable String taxCode) { - PDNDBusiness business = pdndInfoCamereService.retrieveInstitutionPdndByTaxCode(taxCode); - return ResponseEntity.ok().body(pdndBusinessMapper.toResource(business)); - } + @Tag(name = "internal-v1") + @ResponseStatus(HttpStatus.OK) + @ApiOperation( + value = "${swagger.api.infocamere-pdnd.institution.summary}", + notes = "${swagger.api.infocamere-pdnd.institution.notes}") + @GetMapping("/institution/{taxCode}") + public ResponseEntity institutionPdndByTaxCode( + @ApiParam("${swagger.model.institution.taxCode}") @PathVariable String taxCode) { + PDNDBusiness business = pdndInfoCamereService.retrieveInstitutionPdndByTaxCode(taxCode); + return ResponseEntity.ok().body(pdndBusinessMapper.toResource(business)); + } } From c4c7dd49e950df8df47a0c1c4b9ccd6f0b722577 Mon Sep 17 00:00:00 2001 From: gianmarcoplutino Date: Wed, 6 Nov 2024 12:28:50 +0100 Subject: [PATCH 2/2] feat: updated tag name for infocamere PDND --- app/src/main/resources/swagger/api-docs.json | 6 +++--- .../web/controller/PDNDInfoCamereController.java | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/resources/swagger/api-docs.json b/app/src/main/resources/swagger/api-docs.json index cca9f61a..248f6d78 100644 --- a/app/src/main/resources/swagger/api-docs.json +++ b/app/src/main/resources/swagger/api-docs.json @@ -32,7 +32,7 @@ "name" : "infocamere", "description" : "Info Camere Controller" }, { - "name" : "infocamere PDND", + "name" : "infocamere-pdnd", "description" : "PDND Info Camere Controller" }, { "name" : "institution", @@ -1143,7 +1143,7 @@ }, "/infocamere-pdnd/institution/{taxCode}" : { "get" : { - "tags" : [ "internal-v1" ], + "tags" : [ "infocamere-pdnd", "internal-v1" ], "summary" : "Get institution by institution taxCode", "description" : "Get the company represented by taxCode of the institution passed as a parameter", "operationId" : "institutionPdndByTaxCodeUsingGET", @@ -1216,7 +1216,7 @@ }, "/infocamere-pdnd/institutions" : { "get" : { - "tags" : [ "infocamere PDND" ], + "tags" : [ "infocamere-pdnd" ], "summary" : "Get institutions by institution description", "description" : "Get the list of companies represented by description of the institutions passed as a parameter", "operationId" : "institutionsPdndByDescriptionUsingGET", diff --git a/web/src/main/java/it/pagopa/selfcare/party/registry_proxy/web/controller/PDNDInfoCamereController.java b/web/src/main/java/it/pagopa/selfcare/party/registry_proxy/web/controller/PDNDInfoCamereController.java index 11e65ccc..1d79b038 100644 --- a/web/src/main/java/it/pagopa/selfcare/party/registry_proxy/web/controller/PDNDInfoCamereController.java +++ b/web/src/main/java/it/pagopa/selfcare/party/registry_proxy/web/controller/PDNDInfoCamereController.java @@ -19,7 +19,7 @@ @Slf4j @RestController @RequestMapping(value = "/infocamere-pdnd", produces = MediaType.APPLICATION_JSON_VALUE) -@Api(tags = "infocamere PDND") +@Api(tags = "infocamere-pdnd") public class PDNDInfoCamereController { private final PDNDInfoCamereService pdndInfoCamereService; @@ -45,6 +45,7 @@ public ResponseEntity> institutionsPdndByDescription( } @Tag(name = "internal-v1") + @Tag(name = "infocamere-pdnd") @ResponseStatus(HttpStatus.OK) @ApiOperation( value = "${swagger.api.infocamere-pdnd.institution.summary}",