Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: #32 모델 추천 api 수정 #36

Merged
merged 1 commit into from
Mar 8, 2024
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 @@ -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
Loading