Skip to content

Commit 707700a

Browse files
committed
fix
1 parent 78377f5 commit 707700a

File tree

6 files changed

+24
-26
lines changed

6 files changed

+24
-26
lines changed

backend/src/main/java/com/ai/lawyer/domain/search/service/SearchService.java

Lines changed: 0 additions & 9 deletions
This file was deleted.

backend/src/main/java/com/ai/lawyer/domain/search/controller/SearchController.java renamed to backend/src/main/java/com/ai/lawyer/domain/totalSearch/controller/TotalSearchController.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
package com.ai.lawyer.domain.search.controller;
1+
package com.ai.lawyer.domain.totalSearch.controller;
22

3-
import com.ai.lawyer.domain.search.dto.SearchRequestDto;
4-
import com.ai.lawyer.domain.search.dto.SearchResponseDto;
5-
import com.ai.lawyer.domain.search.service.SearchService;
3+
import com.ai.lawyer.domain.totalSearch.dto.SearchRequestDto;
4+
import com.ai.lawyer.domain.totalSearch.dto.SearchResponseDto;
5+
import com.ai.lawyer.domain.totalSearch.service.SearchService;
66
import io.swagger.v3.oas.annotations.Operation;
77
import io.swagger.v3.oas.annotations.tags.Tag;
88
import lombok.RequiredArgsConstructor;
@@ -16,14 +16,14 @@
1616
@Slf4j
1717
@RestController
1818
@RequiredArgsConstructor
19-
@RequestMapping("/api/search")
19+
@RequestMapping("/api/totalSearch")
2020
@Tag(name = "통합 검색", description = "법령 + 판례 통합 검색 API")
21-
public class SearchController {
21+
public class TotalSearchController {
2222

2323
private final SearchService searchService;
2424

25-
@PostMapping("/combined")
26-
@Operation(summary = "법령 + 판례 통합 검색", description = "법령과 판례를 함께 검색합니다. includeLaws/includePrecedents 플래그로 선택 가능합니다.")
25+
@PostMapping("/search")
26+
@Operation(summary = "법령 + 판례 통합 검색", description = "법령과 판례를 함께 검색합니다.")
2727
public ResponseEntity<?> combinedSearch(@RequestBody SearchRequestDto request) {
2828
try {
2929
SearchResponseDto response = searchService.combinedSearch(request);

backend/src/main/java/com/ai/lawyer/domain/search/dto/SearchRequestDto.java renamed to backend/src/main/java/com/ai/lawyer/domain/totalSearch/dto/SearchRequestDto.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.ai.lawyer.domain.search.dto;
1+
package com.ai.lawyer.domain.totalSearch.dto;
22

33
import io.swagger.v3.oas.annotations.media.Schema;
44
import lombok.AllArgsConstructor;

backend/src/main/java/com/ai/lawyer/domain/search/dto/SearchResponseDto.java renamed to backend/src/main/java/com/ai/lawyer/domain/totalSearch/dto/SearchResponseDto.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.ai.lawyer.domain.search.dto;
1+
package com.ai.lawyer.domain.totalSearch.dto;
22

33
import com.ai.lawyer.global.dto.PageResponseDto;
44
import io.swagger.v3.oas.annotations.media.Schema;
@@ -13,10 +13,10 @@
1313
@AllArgsConstructor
1414
public class SearchResponseDto {
1515

16-
@Schema(description = "법령 검색 결과 페이지 (없으면 null)")
16+
@Schema(description = "법령 검색 결과 페이지")
1717
private PageResponseDto laws;
1818

19-
@Schema(description = "판례 검색 결과 페이지 (없으면 null)")
19+
@Schema(description = "판례 검색 결과 페이지")
2020
private PageResponseDto precedents;
2121
}
2222

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.ai.lawyer.domain.totalSearch.service;
2+
3+
import com.ai.lawyer.domain.totalSearch.dto.SearchRequestDto;
4+
import com.ai.lawyer.domain.totalSearch.dto.SearchResponseDto;
5+
6+
public interface SearchService {
7+
SearchResponseDto combinedSearch(SearchRequestDto request);
8+
}
9+

backend/src/main/java/com/ai/lawyer/domain/search/service/SearchServiceImpl.java renamed to backend/src/main/java/com/ai/lawyer/domain/totalSearch/service/SearchServiceImpl.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
package com.ai.lawyer.domain.search.service;
1+
package com.ai.lawyer.domain.totalSearch.service;
22

33
import com.ai.lawyer.domain.law.dto.LawSearchRequestDto;
44
import com.ai.lawyer.domain.law.service.LawService;
55
import com.ai.lawyer.domain.precedent.dto.PrecedentSearchRequestDto;
66
import com.ai.lawyer.domain.precedent.service.PrecedentService;
7-
import com.ai.lawyer.domain.search.dto.SearchRequestDto;
8-
import com.ai.lawyer.domain.search.dto.SearchResponseDto;
7+
import com.ai.lawyer.domain.totalSearch.dto.SearchRequestDto;
8+
import com.ai.lawyer.domain.totalSearch.dto.SearchResponseDto;
99
import com.ai.lawyer.global.dto.PageResponseDto;
1010
import lombok.RequiredArgsConstructor;
1111
import lombok.extern.slf4j.Slf4j;
@@ -62,7 +62,6 @@ public SearchResponseDto combinedSearch(SearchRequestDto request) {
6262
});
6363
}
6464

65-
// Wait for both futures (if present)
6665
if (lawFuture != null) {
6766
Object lawResult = lawFuture.join();
6867
response.setLaws(lawResult == null ? null : (PageResponseDto) lawResult);
@@ -73,7 +72,6 @@ public SearchResponseDto combinedSearch(SearchRequestDto request) {
7372
response.setPrecedents(precResult == null ? null : (PageResponseDto) precResult);
7473
}
7574

76-
// If both are null and both were requested, throw to indicate overall failure
7775
if (request.isIncludeLaws() && request.isIncludePrecedents()
7876
&& response.getLaws() == null && response.getPrecedents() == null) {
7977
throw new RuntimeException("법령 및 판례 검색 모두 실패");

0 commit comments

Comments
 (0)