fix: resolve compile errors in quarkus code examples

- Add missing @Slf4j and bucketName field to FileStorageService
- Fix PaginatedList → List type mismatch (Panache returns List)
- Fix executorService.submit → execute mock (supplyAsync uses execute)
- Update S3 failure test to throw from putObject instead of failed future

Applied to English + all 3 locale copies (tr, ja-JP, zh-CN).
This commit is contained in:
AlexisLeDain
2026-04-09 16:00:56 +02:00
parent ca7ff001ce
commit 9b4704fe3d
6 changed files with 50 additions and 29 deletions
+5 -2
View File
@@ -340,7 +340,7 @@ public class DocumentResource {
public Response list(
@QueryParam("page") @DefaultValue("0") int page,
@QueryParam("size") @DefaultValue("20") int size) {
PaginatedList<Document> documents = documentService.list(page, size);
List<Document> documents = documentService.list(page, size);
return Response.ok(documents).build();
}
@@ -415,7 +415,7 @@ public class DocumentService {
return repo.findByIdOptional(id);
}
public PaginatedList<Document> list(int page, int size) {
public List<Document> list(int page, int size) {
return repo.findAll()
.page(page, size)
.list();
@@ -474,12 +474,15 @@ public class GenericExceptionMapper implements ExceptionMapper<Exception> {
## CompletableFuture非同期操作
```java
@Slf4j
@ApplicationScoped
@RequiredArgsConstructor
public class FileStorageService {
private final S3Client s3Client;
private final ExecutorService executorService;
@ConfigProperty(name = "storage.bucket-name") String bucketName;
public CompletableFuture<StoredDocumentInfo> uploadOriginalFile(
InputStream inputStream,
long size,