Added tags to group REST methods
This commit is contained in:
parent
9e3753f9c6
commit
2b39bb8682
|
@ -6,6 +6,7 @@ import jakarta.ws.rs.core.Response
|
||||||
import net.codinux.invoicing.model.Invoice
|
import net.codinux.invoicing.model.Invoice
|
||||||
import net.codinux.invoicing.service.InvoicingService
|
import net.codinux.invoicing.service.InvoicingService
|
||||||
import org.eclipse.microprofile.openapi.annotations.Operation
|
import org.eclipse.microprofile.openapi.annotations.Operation
|
||||||
|
import org.eclipse.microprofile.openapi.annotations.tags.Tag
|
||||||
import org.jboss.resteasy.reactive.PartType
|
import org.jboss.resteasy.reactive.PartType
|
||||||
import org.jboss.resteasy.reactive.RestForm
|
import org.jboss.resteasy.reactive.RestForm
|
||||||
import org.jboss.resteasy.reactive.multipart.FileUpload
|
import org.jboss.resteasy.reactive.multipart.FileUpload
|
||||||
|
@ -20,12 +21,14 @@ class InvoicingResource(
|
||||||
@Path("xrechnung")
|
@Path("xrechnung")
|
||||||
@POST
|
@POST
|
||||||
@Operation(summary = "Create a XRechnung XML")
|
@Operation(summary = "Create a XRechnung XML")
|
||||||
|
@Tag(name = "Create")
|
||||||
fun createXRechnung(invoice: Invoice) =
|
fun createXRechnung(invoice: Invoice) =
|
||||||
service.createXRechnung(invoice)
|
service.createXRechnung(invoice)
|
||||||
|
|
||||||
@Path("facturx/xml")
|
@Path("facturx/xml")
|
||||||
@POST
|
@POST
|
||||||
@Operation(summary = "Create a Factur-X / ZUGFeRD XML (ZUGFeRD is a synonym for Factur-X)")
|
@Operation(summary = "Create a Factur-X / ZUGFeRD XML (ZUGFeRD is a synonym for Factur-X)")
|
||||||
|
@Tag(name = "Create")
|
||||||
fun createFacturXXml(invoice: Invoice) =
|
fun createFacturXXml(invoice: Invoice) =
|
||||||
service.createFacturXXml(invoice)
|
service.createFacturXXml(invoice)
|
||||||
|
|
||||||
|
@ -33,6 +36,7 @@ class InvoicingResource(
|
||||||
@POST
|
@POST
|
||||||
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
||||||
@Operation(summary = "Create a Factur-X / ZUGFeRD XML, transforms it to PDF and attaches before created XML to it")
|
@Operation(summary = "Create a Factur-X / ZUGFeRD XML, transforms it to PDF and attaches before created XML to it")
|
||||||
|
@Tag(name = "Create")
|
||||||
fun createFacturXPdf(invoice: Invoice): Response {
|
fun createFacturXPdf(invoice: Invoice): Response {
|
||||||
val pdfFile = service.createFacturXPdf(invoice)
|
val pdfFile = service.createFacturXPdf(invoice)
|
||||||
|
|
||||||
|
@ -44,6 +48,7 @@ class InvoicingResource(
|
||||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||||
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
||||||
@Operation(summary = "Attaches the invoice data as EN 16931 XML to a PDF file, combining them to a Factur-X / ZUGFeRD hybrid PDF with XML invoice file")
|
@Operation(summary = "Attaches the invoice data as EN 16931 XML to a PDF file, combining them to a Factur-X / ZUGFeRD hybrid PDF with XML invoice file")
|
||||||
|
@Tag(name = "Create - Attach")
|
||||||
fun attachInvoiceXmlToPdf(
|
fun attachInvoiceXmlToPdf(
|
||||||
@RestForm @PartType(MediaType.APPLICATION_JSON) invoice: Invoice,
|
@RestForm @PartType(MediaType.APPLICATION_JSON) invoice: Invoice,
|
||||||
@RestForm("pdf") pdf: FileUpload
|
@RestForm("pdf") pdf: FileUpload
|
||||||
|
@ -60,6 +65,7 @@ class InvoicingResource(
|
||||||
@Consumes(MediaType.APPLICATION_OCTET_STREAM)
|
@Consumes(MediaType.APPLICATION_OCTET_STREAM)
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@Operation(summary = "Extract invoice data from a Factur-X / ZUGFeRD or XRechnung file")
|
@Operation(summary = "Extract invoice data from a Factur-X / ZUGFeRD or XRechnung file")
|
||||||
|
@Tag(name = "Extract")
|
||||||
fun extractInvoiceData(invoice: FileUpload) =
|
fun extractInvoiceData(invoice: FileUpload) =
|
||||||
service.extractInvoiceData(invoice.uploadedFile())
|
service.extractInvoiceData(invoice.uploadedFile())
|
||||||
|
|
||||||
|
@ -67,6 +73,7 @@ class InvoicingResource(
|
||||||
@POST
|
@POST
|
||||||
@Consumes(MediaType.APPLICATION_OCTET_STREAM)
|
@Consumes(MediaType.APPLICATION_OCTET_STREAM)
|
||||||
@Operation(summary = "Validate a Factur-X / ZUGFeRD or XRechnung file")
|
@Operation(summary = "Validate a Factur-X / ZUGFeRD or XRechnung file")
|
||||||
|
@Tag(name = "Validate")
|
||||||
fun validateInvoiceXml(invoice: FileUpload) =
|
fun validateInvoiceXml(invoice: FileUpload) =
|
||||||
service.validateInvoice(invoice.uploadedFile()).reportAsXml
|
service.validateInvoice(invoice.uploadedFile()).reportAsXml
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue