@@ -38,26 +38,25 @@ public class SearchController {
3838 private final SearchService searchService ;
3939 private final SearchIndexingService searchIndexingService ;
4040 private final RecentSearchService recentSearchService ;
41- private final ProductService productService ; // 기존 검색 로직 재사용을 위해 주입
42- private final AiSearchService aiSearchService ; // NLP 처리를 위한 가상의 서비스
41+ private final ProductService productService ;
42+ private final AiSearchService aiSearchService ;
4343
44- // 자동 완성
4544 @ GetMapping ("/autocomplete" )
45+ @ Operation (summary = "검색어 자동 완성" , description = "사용자가 입력 중인 검색어에 대한 연관 검색어를 반환합니다.(브랜드, 카테고리)" )
4646 public ResponseEntity <DataResponse <List <String >>> autocomplete (
4747 @ RequestParam String query ) {
4848 List <String > suggestions = searchService .getAutocomplete (query );
4949 return ResponseEntity .ok (DataResponse .from (suggestions ));
5050 }
5151
52- // 추천 검색어
5352 @ GetMapping ("/recommend" )
53+ @ Operation (summary = "추천 검색어 조회" , description = "현재 쇼핑몰의 인기 검색어 리스트를 반환합니다." )
5454 public ResponseEntity <DataResponse <List <String >>> getRecommend () {
5555 return ResponseEntity .ok (DataResponse .from (searchService .getTopKeywords ()));
5656 }
5757
58- // 최근 검색어
5958 @ GetMapping ("/recent" )
60- @ Operation (description = "토큰 필요" )
59+ @ Operation (summary = "최근 검색어 조회" , description = "로그인한 사용자의 최근 검색어 목록을 반환합니다. ( 토큰 필요) " )
6160 public ResponseEntity <DataResponse <List <String >>> getRecent (
6261 @ AuthenticationPrincipal Long userId ) {
6362 if (userId == null ) {
@@ -67,9 +66,8 @@ public ResponseEntity<DataResponse<List<String>>> getRecent(
6766 return ResponseEntity .ok (DataResponse .from (recentSearches ));
6867 }
6968
70- // 최근 검색어 개별 삭제
7169 @ DeleteMapping ("/recent" )
72- @ Operation (description = "토큰 필요" )
70+ @ Operation (summary = "최근 검색어 개별 삭제" , description = "목록에서 특정 키워드를 삭제합니다. ( 토큰 필요) " )
7371 public ResponseEntity <DataResponse <Void >> removeRecent (
7472 @ AuthenticationPrincipal Long userId ,
7573 @ RequestParam String keyword ) {
@@ -79,9 +77,8 @@ public ResponseEntity<DataResponse<Void>> removeRecent(
7977 return ResponseEntity .ok (DataResponse .from (null ));
8078 }
8179
82- // 최근 검색어 전체 삭제
8380 @ DeleteMapping ("/recent/all" )
84- @ Operation (description = "토큰 필요" )
81+ @ Operation (summary = "최근 검색어 전체 삭제" , description = "사용자의 최근 검색어 기록을 모두 초기화합니다. ( 토큰 필요) " )
8582 public ResponseEntity <DataResponse <Void >> clearAllRecent (
8683 @ AuthenticationPrincipal Long userId ) {
8784 if (userId != null ) {
0 commit comments