Skip to content

Commit

Permalink
added oprationId and description
Browse files Browse the repository at this point in the history
  • Loading branch information
ElisKina-dev committed Jul 12, 2024
1 parent 2712c64 commit 0ec2061
Show file tree
Hide file tree
Showing 5 changed files with 156 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import jakarta.ws.rs.core.Response;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.microprofile.openapi.annotations.Operation;
import org.eclipse.microprofile.openapi.annotations.enums.SchemaType;
import org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType;
import org.eclipse.microprofile.openapi.annotations.media.Content;
Expand Down Expand Up @@ -128,6 +129,10 @@ public BpmnResource(BpmnVersionService bpmnVersionService, BpmnBankConfigService
@Path("/{bpmnId}/version/{version}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(
operationId = "getEncodedFile",
description = "Recupera il file BPMN codificato"
)
@APIResponse(responseCode= "200", description = "Ok", content = @Content(schema = @Schema(implementation = BpmnDTO.class)))
@APIResponse(responseCode = "401", description = "Unauthorized", content = @Content(example = "{\"type\":\"UNAUTHORIZED\", \"statusCode\":\"401\", \"message\":\"Richiesta non autorizzata\", \"errorCode\":\"ATMLM_401\"}" ))
@APIResponse(responseCode = "429", description = "Rate limit", content = @Content(example = "{\"type\":\"RATE_LIMIT\", \"statusCode\":\"429\", \"message\":\"Rate limit raggiunto; riprovare in seguito\", \"errorCode\":\"ATMLM_429\"}" ))
Expand All @@ -153,6 +158,10 @@ public Uni<BpmnDTO> getEncodedFile(@PathParam("bpmnId") UUID bpmnId,
@Path("/bank/{acquirerId}/associations/function/{functionType}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Operation(
operationId = "associateBPMN",
description = "Associa BPMN a un acquirer specifico"
)
@APIResponse(responseCode = "401", description = "Unauthorized", content = @Content(example = "{\"type\":\"UNAUTHORIZED\", \"statusCode\":\"401\", \"message\":\"Richiesta non autorizzata\", \"errorCode\":\"ATMLM_401\"}" ))
@APIResponse(responseCode = "429", description = "Rate limit", content = @Content(example = "{\"type\":\"RATE_LIMIT\", \"statusCode\":\"429\", \"message\":\"Rate limit raggiunto; riprovare in seguito\", \"errorCode\":\"ATMLM_429\"}" ))
@APIResponse(responseCode = "4XX", description = "Bad Request", content = @Content(example = "{\"type\":\"BAD_REQUEST\", \"statusCode\":\"4XX\", \"message\":\"Messaggio di errore\", \"errorCode\":\"ATMLM_4000XXX\"}" ))
Expand All @@ -176,6 +185,10 @@ public Uni<BpmnDTO> getEncodedFile(@PathParam("bpmnId") UUID bpmnId,
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.APPLICATION_JSON)
@NonBlocking
@Operation(
operationId = "createBPMN",
description = "Crea un nuovo BPMN"
)
@APIResponse(responseCode= "200", description = "Ok", content = @Content(schema = @Schema(implementation = BpmnDTO.class)))
@APIResponse(responseCode = "401", description = "Unauthorized", content = @Content(example = "{\"type\":\"UNAUTHORIZED\", \"statusCode\":\"401\", \"message\":\"Richiesta non autorizzata\", \"errorCode\":\"ATMLM_401\"}" ))
@APIResponse(responseCode = "429", description = "Rate limit", content = @Content(example = "{\"type\":\"RATE_LIMIT\", \"statusCode\":\"429\", \"message\":\"Rate limit raggiunto; riprovare in seguito\", \"errorCode\":\"ATMLM_429\"}" ))
Expand All @@ -195,6 +208,10 @@ public Uni<BpmnDTO> createBPMN(
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("/{bpmnId}/version/{version}")
@Operation(
operationId = "deleteBpmn",
description = "Elimina BPMN"
)
@APIResponse(responseCode= "204", description = "Ok")
@APIResponse(responseCode = "401", description = "Unauthorized", content = @Content(example = "{\"type\":\"UNAUTHORIZED\", \"statusCode\":\"401\", \"message\":\"Richiesta non autorizzata\", \"errorCode\":\"ATMLM_401\"}" ))
@APIResponse(responseCode = "429", description = "Rate limit", content = @Content(example = "{\"type\":\"RATE_LIMIT\", \"statusCode\":\"429\", \"message\":\"Rate limit raggiunto; riprovare in seguito\", \"errorCode\":\"ATMLM_429\"}" ))
Expand All @@ -211,6 +228,10 @@ public Uni<Void> deleteBpmn(@PathParam("bpmnId") UUID bpmnId,
@POST
@Path("/deploy/{uuid}/version/{version}")
@Produces(MediaType.APPLICATION_JSON)
@Operation(
operationId = "deployBpmn",
description = "Rilascio BPMN"
)
@APIResponse(responseCode= "200", description = "Ok", content = @Content(schema = @Schema(implementation = BpmnDTO.class)))
@APIResponse(responseCode = "401", description = "Unauthorized", content = @Content(example = "{\"type\":\"UNAUTHORIZED\", \"statusCode\":\"401\", \"message\":\"Richiesta non autorizzata\", \"errorCode\":\"ATMLM_401\"}" ))
@APIResponse(responseCode = "429", description = "Rate limit", content = @Content(example = "{\"type\":\"RATE_LIMIT\", \"statusCode\":\"429\", \"message\":\"Rate limit raggiunto; riprovare in seguito\", \"errorCode\":\"ATMLM_429\"}" ))
Expand All @@ -226,6 +247,10 @@ public Uni<BpmnDTO> deployBPMN(@PathParam("uuid") UUID uuid,
@POST
@Path("/undeploy/{uuid}")
@Produces(MediaType.APPLICATION_JSON)
@Operation(
operationId = "undeployBpmn",
description = "Disattiva il rilascio di un file BPMN specifico"
)
@APIResponse(responseCode= "204", description = "Ok")
@APIResponse(responseCode = "401", description = "Unauthorized", content = @Content(example = "{\"type\":\"UNAUTHORIZED\", \"statusCode\":\"401\", \"message\":\"Richiesta non autorizzata\", \"errorCode\":\"ATMLM_401\"}" ))
@APIResponse(responseCode = "429", description = "Rate limit", content = @Content(example = "{\"type\":\"RATE_LIMIT\", \"statusCode\":\"429\", \"message\":\"Rate limit raggiunto; riprovare in seguito\", \"errorCode\":\"ATMLM_429\"}" ))
Expand All @@ -240,6 +265,10 @@ public Uni<Void> undeployBPMN(@PathParam("uuid") UUID uuid) {
@GET
@Path("/download/{uuid}/version/{version}")
@Produces(MediaType.APPLICATION_OCTET_STREAM)
@Operation(
operationId = "downloadBpmn",
description = "Scarica file BPMN"
)
@APIResponse(responseCode= "200", description = "Ok", content = @Content(schema = @Schema(implementation = Buffer.class)))
@APIResponse(responseCode = "401", description = "Unauthorized", content = @Content(example = "{\"type\":\"UNAUTHORIZED\", \"statusCode\":\"401\", \"message\":\"Richiesta non autorizzata\", \"errorCode\":\"ATMLM_401\"}" ))
@APIResponse(responseCode = "429", description = "Rate limit", content = @Content(example = "{\"type\":\"RATE_LIMIT\", \"statusCode\":\"429\", \"message\":\"Rate limit raggiunto; riprovare in seguito\", \"errorCode\":\"ATMLM_429\"}" ))
Expand Down Expand Up @@ -273,6 +302,10 @@ public Multi<Buffer> downloadBpmn(@PathParam("uuid") UUID bpmnId,
@GET
@Path("/downloadFrontEnd/{uuid}/version/{version}")
@Produces(MediaType.APPLICATION_JSON)
@Operation(
operationId = "downloadBpmnFrontEnd",
description = "Scarica il file BPMN dal front-end"
)
@APIResponse(responseCode= "200", description = "Ok", content = @Content(schema = @Schema(implementation = FileS3Dto.class)))
@APIResponse(responseCode = "401", description = "Unauthorized", content = @Content(example = "{\"type\":\"UNAUTHORIZED\", \"statusCode\":\"401\", \"message\":\"Richiesta non autorizzata\", \"errorCode\":\"ATMLM_401\"}" ))
@APIResponse(responseCode = "429", description = "Rate limit", content = @Content(example = "{\"type\":\"RATE_LIMIT\", \"statusCode\":\"429\", \"message\":\"Rate limit raggiunto; riprovare in seguito\", \"errorCode\":\"ATMLM_429\"}" ))
Expand Down Expand Up @@ -306,6 +339,10 @@ public Uni<FileS3Dto> downloadBpmnFrontEnd(@PathParam("uuid") UUID bpmnId,
@GET
@Path("/function/{functionType}/bank/{acquirerId}/branch/{branchId}/terminal/{terminalId}")
@Produces(MediaType.APPLICATION_JSON)
@Operation(
operationId = "findBPMNByTriad",
description = "Cerca file BPMN per tripletta: acquirerId, branchId e terminalId"
)
@APIResponse(responseCode= "200", description = "Ok", content = @Content(schema = @Schema(implementation = BpmnDTO.class)))
@APIResponse(responseCode = "401", description = "Unauthorized", content = @Content(example = "{\"type\":\"UNAUTHORIZED\", \"statusCode\":\"401\", \"message\":\"Richiesta non autorizzata\", \"errorCode\":\"ATMLM_401\"}" ))
@APIResponse(responseCode = "429", description = "Rate limit", content = @Content(example = "{\"type\":\"RATE_LIMIT\", \"statusCode\":\"429\", \"message\":\"Rate limit raggiunto; riprovare in seguito\", \"errorCode\":\"ATMLM_429\"}" ))
Expand Down Expand Up @@ -361,6 +398,10 @@ public Uni<BpmnDTO> findBPMNByTriad(@PathParam("functionType") @Size(max=255) St
@GET
@Path("/process/function/{functionType}/bank/{acquirerId}/branch/{branchId}/terminal/{terminalId}")
@Produces(MediaType.APPLICATION_JSON)
@Operation(
operationId = "findBPMNByTriadForProcessService",
description = "Cerca file BPMN per tripletta acquirerId, branchId e terminalId per Process Service"
)
@APIResponse(responseCode= "200", description = "Ok", content = @Content(schema = @Schema(implementation = BpmnProcessDTO.class)))
@APIResponse(responseCode = "401", description = "Unauthorized", content = @Content(example = "{\"type\":\"UNAUTHORIZED\", \"statusCode\":\"401\", \"message\":\"Richiesta non autorizzata\", \"errorCode\":\"ATMLM_401\"}" ))
@APIResponse(responseCode = "429", description = "Rate limit", content = @Content(example = "{\"type\":\"RATE_LIMIT\", \"statusCode\":\"429\", \"message\":\"Rate limit raggiunto; riprovare in seguito\", \"errorCode\":\"ATMLM_429\"}" ))
Expand All @@ -380,6 +421,10 @@ public Uni<BpmnProcessDTO> findBPMNByTriadForProcessService(
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.APPLICATION_JSON)
@Path("/upgrade")
@Operation(
operationId = "upgradeBPMN",
description = "Aggiorna il file BPMN aumentando la versione"
)
@APIResponse(responseCode= "200", description = "Ok", content = @Content(schema = @Schema(implementation = BpmnDTO.class)))
@APIResponse(responseCode = "401", description = "Unauthorized", content = @Content(example = "{\"type\":\"UNAUTHORIZED\", \"statusCode\":\"401\", \"message\":\"Richiesta non autorizzata\", \"errorCode\":\"ATMLM_401\"}" ))
@APIResponse(responseCode = "429", description = "Rate limit", content = @Content(example = "{\"type\":\"RATE_LIMIT\", \"statusCode\":\"429\", \"message\":\"Rate limit raggiunto; riprovare in seguito\", \"errorCode\":\"ATMLM_429\"}" ))
Expand All @@ -393,6 +438,10 @@ public Uni<BpmnDTO> upgradeBPMN(@Valid BpmnUpgradeDto bpmnUpgradeDto) {
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("/associations/bank/{acquirerId}")
@Operation(
operationId = "getAssociations",
description = "cerca associazioni di un acquirerId"
)
@APIResponse(responseCode = "200", description = "Ok", content = @Content(schema = @Schema(type = SchemaType.ARRAY, implementation = BpmnBankConfigDTO.class)))
@APIResponse(responseCode = "401", description = "Unauthorized", content = @Content(example = "{\"type\":\"UNAUTHORIZED\", \"statusCode\":\"401\", \"message\":\"Richiesta non autorizzata\", \"errorCode\":\"ATMLM_401\"}" ))
@APIResponse(responseCode = "429", description = "Rate limit", content = @Content(example = "{\"type\":\"RATE_LIMIT\", \"statusCode\":\"429\", \"message\":\"Rate limit raggiunto; riprovare in seguito\", \"errorCode\":\"ATMLM_429\"}" ))
Expand All @@ -404,6 +453,10 @@ public Uni<BpmnDTO> upgradeBPMN(@Valid BpmnUpgradeDto bpmnUpgradeDto) {

@POST
@Path("/disable/{uuid}/version/{version}")
@Operation(
operationId = "disableBPMN",
description = "disabilita un file BPMN"
)
@APIResponse(responseCode= "204", description = "Ok")
@APIResponse(responseCode = "401", description = "Unauthorized", content = @Content(example = "{\"type\":\"UNAUTHORIZED\", \"statusCode\":\"401\", \"message\":\"Richiesta non autorizzata\", \"errorCode\":\"ATMLM_401\"}" ))
@APIResponse(responseCode = "429", description = "Rate limit", content = @Content(example = "{\"type\":\"RATE_LIMIT\", \"statusCode\":\"429\", \"message\":\"Rate limit raggiunto; riprovare in seguito\", \"errorCode\":\"ATMLM_429\"}" ))
Expand All @@ -417,6 +470,10 @@ public Uni<Void> disableBPMN(@PathParam("uuid") UUID bpmnId, @PathParam("version
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("/filter")
@Operation(
operationId = "getBpmnFiltered",
description = "cerca BPMN mettendo dei filtri"
)
@APIResponse(responseCode = "401", description = "Unauthorized", content = @Content(example = "{\"type\":\"UNAUTHORIZED\", \"statusCode\":\"401\", \"message\":\"Richiesta non autorizzata\", \"errorCode\":\"ATMLM_401\"}" ))
@APIResponse(responseCode = "429", description = "Rate limit", content = @Content(example = "{\"type\":\"RATE_LIMIT\", \"statusCode\":\"429\", \"message\":\"Rate limit raggiunto; riprovare in seguito\", \"errorCode\":\"ATMLM_429\"}" ))
@APIResponse(responseCode = "4XX", description = "Bad Request", content = @Content(example = "{\"type\":\"BAD_REQUEST\", \"statusCode\":\"4XX\", \"message\":\"Messaggio di errore\", \"errorCode\":\"ATMLM_4000XXX\"}" ))
Expand Down Expand Up @@ -454,6 +511,10 @@ public Uni<PageInfo<BpmnFrontEndDTO>> getBpmnFiltered(@QueryParam("pageIndex") @
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("/associations/{uuid}/version/{version}")
@Operation(
operationId = "getAssociationsByBpmn",
description = "cerca associazioni di un BPMN"
)
@APIResponse(responseCode = "401", description = "Unauthorized", content = @Content(example = "{\"type\":\"UNAUTHORIZED\", \"statusCode\":\"401\", \"message\":\"Richiesta non autorizzata\", \"errorCode\":\"ATMLM_401\"}" ))
@APIResponse(responseCode = "429", description = "Rate limit", content = @Content(example = "{\"type\":\"RATE_LIMIT\", \"statusCode\":\"429\", \"message\":\"Rate limit raggiunto; riprovare in seguito\", \"errorCode\":\"ATMLM_429\"}" ))
@APIResponse(responseCode = "4XX", description = "Bad Request", content = @Content(example = "{\"type\":\"BAD_REQUEST\", \"statusCode\":\"4XX\", \"message\":\"Messaggio di errore\", \"errorCode\":\"ATMLM_4000XXX\"}" ))
Expand All @@ -475,6 +536,10 @@ public Uni<PageInfo<BpmnBankConfigDTO>> getAssociationsByBpmn(@PathParam("uuid")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("/associations/{uuid}/version/{version}")
@Operation(
operationId = "addSingleAssociation",
description = "aggiungi una singola associazione"
)
@APIResponse(responseCode= "200", description = "Ok", content = @Content(schema = @Schema(implementation = BpmnBankConfigDTO.class)))
@APIResponse(responseCode = "401", description = "Unauthorized", content = @Content(example = "{\"type\":\"UNAUTHORIZED\", \"statusCode\":\"401\", \"message\":\"Richiesta non autorizzata\", \"errorCode\":\"ATMLM_401\"}" ))
@APIResponse(responseCode = "429", description = "Rate limit", content = @Content(example = "{\"type\":\"RATE_LIMIT\", \"statusCode\":\"429\", \"message\":\"Rate limit raggiunto; riprovare in seguito\", \"errorCode\":\"ATMLM_429\"}" ))
Expand All @@ -489,6 +554,10 @@ public Uni<BpmnBankConfigDTO> addSingleAssociation(@PathParam("uuid") UUID bpmnI

@DELETE
@Path("/associations/{uuid}/version/{version}")
@Operation(
operationId = "deleteSingleAssociation",
description = "elimina una singola associazione"
)
@APIResponse(responseCode= "204", description = "Ok")
@APIResponse(responseCode = "401", description = "Unauthorized", content = @Content(example = "{\"type\":\"UNAUTHORIZED\", \"statusCode\":\"401\", \"message\":\"Richiesta non autorizzata\", \"errorCode\":\"ATMLM_401\"}" ))
@APIResponse(responseCode = "429", description = "Rate limit", content = @Content(example = "{\"type\":\"RATE_LIMIT\", \"statusCode\":\"429\", \"message\":\"Rate limit raggiunto; riprovare in seguito\", \"errorCode\":\"ATMLM_429\"}" ))
Expand All @@ -507,6 +576,10 @@ public Uni<Void> deleteSingleAssociation(@PathParam("uuid") UUID bpmnId, @PathPa
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("/associations/{uuid}/version/{version}")
@Operation(
operationId = "replaceSingleAssociation",
description = "sostituisci una singola associazione"
)
@APIResponse(responseCode= "200", description = "Ok", content = @Content(schema = @Schema(implementation = BpmnBankConfigDTO.class)))
@APIResponse(responseCode = "401", description = "Unauthorized", content = @Content(example = "{\"type\":\"UNAUTHORIZED\", \"statusCode\":\"401\", \"message\":\"Richiesta non autorizzata\", \"errorCode\":\"ATMLM_401\"}" ))
@APIResponse(responseCode = "429", description = "Rate limit", content = @Content(example = "{\"type\":\"RATE_LIMIT\", \"statusCode\":\"429\", \"message\":\"Rate limit raggiunto; riprovare in seguito\", \"errorCode\":\"ATMLM_429\"}" ))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class InfoResource {
String environment;


@Operation(summary = "Application info - ATM Layer - Model")
@Operation(summary = "Application info - ATM Layer - Model", operationId = "info", description = "Info")
@APIResponses(
value = {
@APIResponse(ref = "#/components/responses/InternalServerError"),
Expand Down
Loading

0 comments on commit 0ec2061

Please sign in to comment.