From 379f690cdce0dce54392da41b974bde90ba12060 Mon Sep 17 00:00:00 2001 From: yuhalog Date: Wed, 18 Jun 2025 10:48:45 +0900 Subject: [PATCH] refactor: poster content --- smarketing-java/build.gradle | 4 +++- .../content/domain/service/BlobStorageServiceImpl.java | 10 +++++----- .../external/PythonAiPosterGenerator.java | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/smarketing-java/build.gradle b/smarketing-java/build.gradle index 3bd1308..01426b7 100644 --- a/smarketing-java/build.gradle +++ b/smarketing-java/build.gradle @@ -57,7 +57,9 @@ subprojects { implementation 'com.azure:azure-storage-blob:12.25.0' implementation 'com.azure:azure-identity:1.11.1' - implementation 'com.fasterxml.jackson.core:jackson-databind:2.12.3' + implementation 'com.fasterxml.jackson.core:jackson-core' + implementation 'com.fasterxml.jackson.core:jackson-databind' + implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310' implementation 'org.springframework.boot:spring-boot-starter-webflux' } diff --git a/smarketing-java/marketing-content/src/main/java/com/won/smarketing/content/domain/service/BlobStorageServiceImpl.java b/smarketing-java/marketing-content/src/main/java/com/won/smarketing/content/domain/service/BlobStorageServiceImpl.java index d37a0ea..c9b9d40 100644 --- a/smarketing-java/marketing-content/src/main/java/com/won/smarketing/content/domain/service/BlobStorageServiceImpl.java +++ b/smarketing-java/marketing-content/src/main/java/com/won/smarketing/content/domain/service/BlobStorageServiceImpl.java @@ -152,12 +152,12 @@ public class BlobStorageServiceImpl implements BlobStorageService { * @param files 검증할 파일 */ private void validateImageFile(List files) { - for (MultipartFile file : files) { - // 파일 존재 여부 확인 - if (file == null || file.isEmpty()) { - throw new BusinessException(ErrorCode.FILE_NOT_FOUND); - } + // 파일 존재 여부 확인 + if (files == null || files.isEmpty()) { + throw new BusinessException(ErrorCode.FILE_NOT_FOUND); + } + for (MultipartFile file : files) { // 파일 크기 확인 if (file.getSize() > maxFileSize) { throw new BusinessException(ErrorCode.FILE_SIZE_EXCEEDED); diff --git a/smarketing-java/marketing-content/src/main/java/com/won/smarketing/content/infrastructure/external/PythonAiPosterGenerator.java b/smarketing-java/marketing-content/src/main/java/com/won/smarketing/content/infrastructure/external/PythonAiPosterGenerator.java index 1fc2020..fc1405c 100644 --- a/smarketing-java/marketing-content/src/main/java/com/won/smarketing/content/infrastructure/external/PythonAiPosterGenerator.java +++ b/smarketing-java/marketing-content/src/main/java/com/won/smarketing/content/infrastructure/external/PythonAiPosterGenerator.java @@ -46,7 +46,7 @@ public class PythonAiPosterGenerator implements AiPosterGenerator { // Python AI 서비스 호출 Map response = webClient .post() - .uri(aiServiceBaseUrl + "/api/ai/poster") + .uri("http://localhost:5001" + "/api/ai/poster") .header("Content-Type", "application/json") .bodyValue(requestBody) .retrieve()