File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
back/src/main/java/com/back/global/ai/client/image Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .back .global .ai .client .image ;
2+
3+ import lombok .extern .slf4j .Slf4j ;
4+ import org .springframework .boot .autoconfigure .condition .ConditionalOnMissingBean ;
5+ import org .springframework .stereotype .Component ;
6+
7+ import java .util .Map ;
8+ import java .util .concurrent .CompletableFuture ;
9+
10+ /**
11+ * 이미지 AI 기능이 비활성화되었을 때 사용되는 NoOp 구현체.
12+ * 실제 이미지를 생성하지 않고 placeholder URL을 반환합니다.
13+ *
14+ * 활성화 조건:
15+ * - ai.image.enabled=false인 경우
16+ * - STABILITY_API_KEY가 설정되지 않은 경우
17+ * - S3 연결이 불가능한 프로덕션 환경
18+ */
19+ @ Slf4j
20+ @ Component
21+ @ ConditionalOnMissingBean (ImageAiClient .class )
22+ public class NoOpImageAiClient implements ImageAiClient {
23+
24+ public NoOpImageAiClient () {
25+ log .info ("NoOpImageAiClient initialized - Image generation is disabled" );
26+ }
27+
28+ @ Override
29+ public CompletableFuture <String > generateImage (String prompt ) {
30+ log .debug ("Image generation disabled. Returning placeholder for prompt: {}" , prompt );
31+ return CompletableFuture .completedFuture ("placeholder-image-url" );
32+ }
33+
34+ @ Override
35+ public CompletableFuture <String > generateImage (String prompt , Map <String , Object > options ) {
36+ log .debug ("Image generation disabled. Returning placeholder for prompt: {}" , prompt );
37+ return CompletableFuture .completedFuture ("placeholder-image-url" );
38+ }
39+
40+ @ Override
41+ public boolean isEnabled () {
42+ return false ;
43+ }
44+ }
You can’t perform that action at this time.
0 commit comments