Skip to content

Commit

Permalink
feat: #32 모델 추천 api 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
lsm-del committed Mar 8, 2024
1 parent 41494ca commit e0771b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ public record ModelRecommendResponseList(
List<ModelRecommendResponse> actors,
@Schema(name = "singers", description = "모델 추천에서 가수 리스트")
List<ModelRecommendResponse> singers,
@Schema(name = "idols", description = "모델 추천에서 아이돌 리스트")
List<ModelRecommendResponse> idols
@Schema(name = "youtuber", description = "모델 추천에서 유튜버 리스트")
List<ModelRecommendResponse> youtuber
) {

}
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,17 @@ public ModelRecommendResponseList getRecommendModel(){

List<ModelRecommendResponse> actors = new ArrayList<>();
List<ModelRecommendResponse> singers = new ArrayList<>();
List<ModelRecommendResponse> idols = new ArrayList<>();
List<ModelRecommendResponse> youtuber = new ArrayList<>();

modelRepository.findAllRecommendModel().stream()
.forEach(response -> {
if(response.job().equals("배우")) // 배우인 경우
if(response.job().contains("배우")) // 배우인 경우
actors.add(response);
else if(response.job().equals("가수")) // 가수인 경우
singers.add(response);
else idols.add(response); // 아이돌인 경우
else youtuber.add(response); // 유튜버인 경우
});
return new ModelRecommendResponseList(actors,singers,idols);
return new ModelRecommendResponseList(actors,singers,youtuber);
}
/**
* 광고 상품 엔티티 생성
Expand Down

0 comments on commit e0771b3

Please sign in to comment.