chore: update
This commit is contained in:
+11
-6
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<project
|
<project
|
||||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
@@ -16,9 +16,11 @@
|
|||||||
<artifactId>file-service</artifactId>
|
<artifactId>file-service</artifactId>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<quarkus.container-image.registry>vps.demonkernel.io.vn</quarkus.container-image.registry>
|
<quarkus.container-image.registry
|
||||||
|
>vps.demonkernel.io.vn</quarkus.container-image.registry>
|
||||||
<quarkus.container-image.group>foodsurf</quarkus.container-image.group>
|
<quarkus.container-image.group>foodsurf</quarkus.container-image.group>
|
||||||
<quarkus.container-image.name>file-service</quarkus.container-image.name>
|
<quarkus.container-image.name
|
||||||
|
>file-service</quarkus.container-image.name>
|
||||||
|
|
||||||
<python.image.full.name>
|
<python.image.full.name>
|
||||||
${quarkus.container-image.registry}/${quarkus.container-image.group}/${quarkus.container-image.name}</python.image.full.name>
|
${quarkus.container-image.registry}/${quarkus.container-image.group}/${quarkus.container-image.name}</python.image.full.name>
|
||||||
@@ -46,13 +48,16 @@
|
|||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<executable>docker</executable>
|
<executable>docker</executable>
|
||||||
<workingDirectory>${project.basedir}/python</workingDirectory>
|
<workingDirectory
|
||||||
|
>${project.basedir}/python</workingDirectory>
|
||||||
<arguments>
|
<arguments>
|
||||||
<argument>build</argument>
|
<argument>build</argument>
|
||||||
<argument>-t</argument>
|
<argument>-t</argument>
|
||||||
<argument>${python.image.full.name}:${parent.version}</argument>
|
<argument
|
||||||
|
>${python.image.full.name}:${parent.version}</argument>
|
||||||
<argument>-t</argument>
|
<argument>-t</argument>
|
||||||
<argument>${python.image.full.name}:latest</argument>
|
<argument
|
||||||
|
>${python.image.full.name}:latest</argument>
|
||||||
<argument>.</argument>
|
<argument>.</argument>
|
||||||
</arguments>
|
</arguments>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
@@ -151,8 +151,8 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
<argLine>@{argLine}</argLine>
|
<argLine>@{argLine}</argLine>
|
||||||
<systemPropertyVariables>
|
<systemPropertyVariables>
|
||||||
<native.image.path>
|
<native.image.path
|
||||||
${project.build.directory}/${project.build.finalName}-runner</native.image.path>
|
>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
|
||||||
<java.util.logging.manager
|
<java.util.logging.manager
|
||||||
>org.jboss.logmanager.LogManager</java.util.logging.manager>
|
>org.jboss.logmanager.LogManager</java.util.logging.manager>
|
||||||
<maven.home>${maven.home}</maven.home>
|
<maven.home>${maven.home}</maven.home>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.drinkool.controller;
|
package com.drinkool.controller;
|
||||||
|
|
||||||
import com.drinkool.lib.dtos.UploadFile;
|
|
||||||
import com.drinkool.services.FileService;
|
import com.drinkool.services.FileService;
|
||||||
import io.smallrye.mutiny.Uni;
|
import io.smallrye.mutiny.Uni;
|
||||||
import jakarta.inject.Inject;
|
import jakarta.inject.Inject;
|
||||||
@@ -9,7 +8,9 @@ import jakarta.ws.rs.POST;
|
|||||||
import jakarta.ws.rs.Path;
|
import jakarta.ws.rs.Path;
|
||||||
import jakarta.ws.rs.PathParam;
|
import jakarta.ws.rs.PathParam;
|
||||||
import jakarta.ws.rs.core.Response;
|
import jakarta.ws.rs.core.Response;
|
||||||
|
import java.io.File;
|
||||||
import org.eclipse.microprofile.rest.client.inject.RestClient;
|
import org.eclipse.microprofile.rest.client.inject.RestClient;
|
||||||
|
import org.jboss.resteasy.reactive.RestForm;
|
||||||
|
|
||||||
@Path("/api/file")
|
@Path("/api/file")
|
||||||
public class FileController {
|
public class FileController {
|
||||||
@@ -19,8 +20,8 @@ public class FileController {
|
|||||||
FileService fileService;
|
FileService fileService;
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
public Uni<Response> upload(UploadFile input) {
|
public Uni<Response> upload(@RestForm File file) {
|
||||||
return fileService.upload(input);
|
return fileService.upload(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
|
|||||||
@@ -1,19 +1,20 @@
|
|||||||
package com.drinkool.services;
|
package com.drinkool.services;
|
||||||
|
|
||||||
import com.drinkool.lib.dtos.UploadFile;
|
|
||||||
import io.smallrye.mutiny.Uni;
|
import io.smallrye.mutiny.Uni;
|
||||||
import jakarta.ws.rs.GET;
|
import jakarta.ws.rs.GET;
|
||||||
import jakarta.ws.rs.POST;
|
import jakarta.ws.rs.POST;
|
||||||
import jakarta.ws.rs.Path;
|
import jakarta.ws.rs.Path;
|
||||||
import jakarta.ws.rs.PathParam;
|
import jakarta.ws.rs.PathParam;
|
||||||
import jakarta.ws.rs.core.Response;
|
import jakarta.ws.rs.core.Response;
|
||||||
|
import java.io.File;
|
||||||
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
|
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
|
||||||
|
import org.jboss.resteasy.reactive.RestForm;
|
||||||
|
|
||||||
@RegisterRestClient(configKey = "file")
|
@RegisterRestClient(configKey = "file")
|
||||||
@Path("/")
|
@Path("/")
|
||||||
public interface FileService {
|
public interface FileService {
|
||||||
@POST
|
@POST
|
||||||
Uni<Response> upload(UploadFile input);
|
Uni<Response> upload(@RestForm File file);
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("/{name}")
|
@Path("/{name}")
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
package com.drinkool.lib.dtos;
|
|
||||||
|
|
||||||
import io.vertx.ext.web.FileUpload;
|
|
||||||
|
|
||||||
public class UploadFile {
|
|
||||||
|
|
||||||
public FileUpload file;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user