Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ public ResponseEntity<?> retrieveRecentRecordImages(
@GetMapping("/search")
public ResponseEntity<?> searchKeyword(
@Parameter(description = "User의 토큰을 입력해주세요.", required = true) @AuthenticationPrincipal UserPrincipal userPrincipal,
@Parameter(description = "검색할 명사를 입력해주세요.", required = true) @RequestBody SearchKeywordReq searchKeywordReq
@Parameter(description = "검색할 명사를 입력해주세요.", required = true) @RequestParam String keyword
) {
List<SearchKeywordRes> result = recordService.searchKeyword(userPrincipal, searchKeywordReq);
List<SearchKeywordRes> result = recordService.searchKeyword(userPrincipal, keyword);
return ResponseEntity.ok(ApiResponseUtil.success(result));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,9 @@ public List<RecentRecordImagesRes> retrieveRecentRecordImages(UserPrincipal user
}


public List<SearchKeywordRes> searchKeyword(UserPrincipal userPrincipal, SearchKeywordReq searchKeywordReq) {
public List<SearchKeywordRes> searchKeyword(UserPrincipal userPrincipal, String keyword) {
User user = validUserById(userPrincipal);
// User user = validUserById(5L);
String keyword = searchKeywordReq.getSearchKeyword();
List<Keyword> keywords = keywordRepository.findAllByUserAndKeywordContaining(user, keyword);
keywords.forEach(k -> log.info("Keyword in DB: {}", k.getKeyword()));

Expand Down