diff --git a/backend/src/main/java/com/ai/lawyer/global/qdrant/service/QdrantService.java b/backend/src/main/java/com/ai/lawyer/global/qdrant/service/QdrantService.java index eeac9361..7be6a003 100644 --- a/backend/src/main/java/com/ai/lawyer/global/qdrant/service/QdrantService.java +++ b/backend/src/main/java/com/ai/lawyer/global/qdrant/service/QdrantService.java @@ -7,6 +7,7 @@ import org.springframework.ai.vectorstore.filter.Filter; import org.springframework.stereotype.Service; +import java.util.Collections; import java.util.List; @Service @@ -24,7 +25,17 @@ public List searchDocument(String query, String key, String value, int .build(); List similarCaseDocuments = vectorStore.similaritySearch(caseSearchRequest); + if (caseSearchRequest == null) { + return Collections.singletonList( + Document.builder() + .text("더미") + .metadata(key, value) + .score(0.0) + .build() + ); + } + return similarCaseDocuments; } -} +} \ No newline at end of file diff --git a/backend/src/main/java/com/ai/lawyer/global/security/SecurityConfig.java b/backend/src/main/java/com/ai/lawyer/global/security/SecurityConfig.java index 5b79a688..6e20d14d 100644 --- a/backend/src/main/java/com/ai/lawyer/global/security/SecurityConfig.java +++ b/backend/src/main/java/com/ai/lawyer/global/security/SecurityConfig.java @@ -47,6 +47,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti .requestMatchers("/api/law/**").permitAll() .requestMatchers("/api/law-word/**").permitAll() .requestMatchers("/h2-console/**").permitAll() + .requestMatchers("/api/chat/**").permitAll() .anyRequest().authenticated() ) // JWT 필터 추가