Files
backend/gateway-service/src/main/java/com/drinkool/controller/FileController.java
T
2026-05-10 08:35:25 +00:00

33 lines
733 B
Java

package com.drinkool.controller;
import com.drinkool.services.FileService;
import io.smallrye.mutiny.Uni;
import jakarta.inject.Inject;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.core.Response;
import java.io.File;
import org.eclipse.microprofile.rest.client.inject.RestClient;
import org.jboss.resteasy.reactive.RestForm;
@Path("/api/file")
public class FileController {
@Inject
@RestClient
FileService fileService;
@POST
public Uni<Response> upload(@RestForm File file) {
return fileService.upload(file);
}
@GET
@Path("/{name}")
public Uni<Response> get(@PathParam("name") String name) {
return fileService.get(name);
}
}