Skip to content

Commit

Permalink
fix: 음식 검색시 응답형식 수정
Browse files Browse the repository at this point in the history
Related to: Issue #15
  • Loading branch information
eckrin committed Nov 21, 2023
1 parent 1995b13 commit c62da35
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/main/java/com/kusitms/jipbap/store/StoreService.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.kusitms.jipbap.common.exception.S3RegisterFailureException;
import com.kusitms.jipbap.common.utils.S3Utils;
import com.kusitms.jipbap.food.dto.FoodDto;
import com.kusitms.jipbap.food.dto.FoodPreviewResponse;
import com.kusitms.jipbap.store.dto.*;
import com.kusitms.jipbap.store.exception.StoreExistsException;
import com.kusitms.jipbap.store.exception.StoreNotExistsException;
Expand Down Expand Up @@ -138,8 +139,8 @@ public StoreFoodResponseDto searchStoresAndFoods(String email, Pageable pageable
)
.collect(Collectors.toList());

List<FoodDto> foodList = foodRepository.searchByNameOrderBySort(user, pageable, keyword, standard, order)
.stream().map(f -> new FoodDto(f.getId(), f.getStore().getId(), f.getCategory().getId(), f.getName(), f.getDollarPrice(), f.getCanadaPrice(), f.getDescription(), f.getImage()))
List<FoodPreviewResponse> foodList = foodRepository.searchByNameOrderBySort(user, pageable, keyword, standard, order)
.stream().map(f -> new FoodPreviewResponse(f.getId(), f.getName(), f.getStore().getId(), f.getStore().getName(), f.getDollarPrice(), f.getCanadaPrice(), f.getImage(), f.getStore().getAvgRate()))
.collect(Collectors.toList());


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.kusitms.jipbap.store.dto;

import com.kusitms.jipbap.food.dto.FoodDto;
import com.kusitms.jipbap.food.dto.FoodPreviewResponse;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
Expand All @@ -15,5 +16,5 @@
public class StoreFoodResponseDto {

private List<StoreDetailResponseDto> stores;
private List<FoodDto> foods;
private List<FoodPreviewResponse> foods;
}

0 comments on commit c62da35

Please sign in to comment.