Skip to content

Commit

Permalink
Merge pull request #85 from Link-MIND/test
Browse files Browse the repository at this point in the history
�[Merge] 검색 기능에 response 추가
  • Loading branch information
sss4920 authored Jan 14, 2024
2 parents e1ac0f7 + 2a6ff3a commit 21d3c50
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import com.app.toaster.controller.response.toast.ToastDto;

public record SearchMainResult(List<ToastDto> toasts, List<CategoryResult> categories) {
public static SearchMainResult of(List<ToastDto> toasts, List<CategoryResult> categories){
return new SearchMainResult(toasts,categories);
public record SearchMainResult(String keyword, List<ToastDto> toasts, List<CategoryResult> categories) {
public static SearchMainResult of(String keyword, List<ToastDto> toasts, List<CategoryResult> categories){
return new SearchMainResult(keyword,toasts,categories);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public ApiResponse<SearchMainResult> searchMain(Long userId, String searchParam)
if (searchToastList.isEmpty() && searchCategoryList.isEmpty()){
return ApiResponse.success(Success.SEARCH_SUCCESS_BUT_IS_EMPTY,null);
}
return ApiResponse.success(Success.SEARCH_SUCCESS, SearchMainResult.of(
return ApiResponse.success(Success.SEARCH_SUCCESS, SearchMainResult.of(searchParam,
searchToastList.stream().map(
toast -> ToastDto.of(toast))
.collect(Collectors.toList()),
Expand Down

0 comments on commit 21d3c50

Please sign in to comment.