All Downloads are FREE. Search and download functionalities are using the official Maven repository.

info.earty.attachment.presentation.AttachmentCommandApi Maven / Gradle / Ivy

package info.earty.attachment.presentation;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Encoding;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.cxf.jaxrs.ext.multipart.Attachment;

import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.QueryParam;
import jakarta.ws.rs.core.MediaType;

@Tag(name = "AttachmentCommand")
@Path("/attachment/command/")
public interface AttachmentCommandApi {

    @POST
    @Path("/create")
    @Consumes(MediaType.MULTIPART_FORM_DATA)
    @Operation(requestBody = @RequestBody(content = @Content(
            mediaType = "multipart/form-data",
            schema = @Schema(implementation = CreateAttachmentRequest.class),
            encoding = {
                    @Encoding(name="file", contentType = MediaType.WILDCARD),
            }
    )))
    void create(@Parameter(hidden = true) Attachment attachment, @QueryParam("workingCardId") String workingCardId);

    class CreateAttachmentRequest {
        @Schema(format = "binary")
        public String file;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy