chore: update
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package com.drinkool.controller;
|
||||
|
||||
import com.drinkool.lib.dtos.UploadFile;
|
||||
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 org.eclipse.microprofile.rest.client.inject.RestClient;
|
||||
|
||||
@Path("/api/file")
|
||||
public class FileController {
|
||||
|
||||
@Inject
|
||||
@RestClient
|
||||
FileService fileService;
|
||||
|
||||
@POST
|
||||
public Uni<Response> upload(UploadFile input) {
|
||||
return fileService.upload(input);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/{name}")
|
||||
public Uni<Response> get(@PathParam("name") String name) {
|
||||
return fileService.get(name);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.drinkool.services;
|
||||
|
||||
import com.drinkool.lib.dtos.UploadFile;
|
||||
import io.smallrye.mutiny.Uni;
|
||||
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 org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
|
||||
|
||||
@RegisterRestClient(configKey = "file")
|
||||
@Path("/")
|
||||
public interface FileService {
|
||||
@POST
|
||||
Uni<Response> upload(UploadFile input);
|
||||
|
||||
@GET
|
||||
@Path("/{name}")
|
||||
Uni<Response> get(@PathParam("name") String name);
|
||||
}
|
||||
@@ -15,6 +15,7 @@ quarkus.native.additional-build-args=--future-defaults=all
|
||||
# Rest Client
|
||||
quarkus.rest-client.account.url=http://account-service
|
||||
quarkus.rest-client.eatery.url=http://eatery-service
|
||||
quarkus.rest-client.file.url=http://file-service
|
||||
|
||||
# GraphQL Client
|
||||
quarkus.smallrye-graphql-client.eatery.url=http://eatery-service/graphql
|
||||
|
||||
+2
-1
@@ -31,7 +31,7 @@ spec:
|
||||
volumes:
|
||||
- name: file-volume
|
||||
persistentVolumeClaim:
|
||||
claimName: image-pvc
|
||||
claimName: file-pvc
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
@@ -54,6 +54,7 @@ spec:
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
nfs:
|
||||
server: 192.168.1.100
|
||||
path: /data/images
|
||||
---
|
||||
apiVersion: v1
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.drinkool.lib.dtos;
|
||||
|
||||
import io.vertx.ext.web.FileUpload;
|
||||
|
||||
public class UploadFile {
|
||||
|
||||
public FileUpload file;
|
||||
}
|
||||
Reference in New Issue
Block a user