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

[점심 메뉴 추천] 김연진 미션 제출합니다. #5

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
2d95a43
docs: 기능 목록 작성
homebdy Sep 10, 2023
433f4ef
feat(OutputView): 추천 시작 안내 메시지 출력 기능 구현
homebdy Sep 10, 2023
053ca07
feat(InputView): 코치의 이름 입력 기능 구현
homebdy Sep 10, 2023
fd1af1b
feat(InputValidator): `,`로 나누지 않은 경우 예외 발생
homebdy Sep 10, 2023
943a93d
feat(Name): 각 이름은 2~4글자가 아닐 경우 예외 발생
homebdy Sep 10, 2023
9de3574
feat(Names): 코치 수가 2명~5명이 아닐 경우 예외 발생
homebdy Sep 10, 2023
52d611a
feat(Coaches): 입력한 이름으로 코치 생성
homebdy Sep 10, 2023
f5d4021
feat(InputView): 각 코치마다 못 먹는 음식 입력
homebdy Sep 10, 2023
0de4f81
feat(ExcludedMenu): 못 먹는 음식 등록
homebdy Sep 10, 2023
8b6f5ca
feat(MenuController): 메서드 분리
homebdy Sep 10, 2023
9d5dcfc
feat(Days): 메뉴 추천 요일 관리
homebdy Sep 10, 2023
6481fb4
feat(Categories): 요일별 카테고리 추천 기능 구현
homebdy Sep 10, 2023
3c816eb
feat(Categories): 이미 2번 추천된 카테고리일 경우 재추천
homebdy Sep 10, 2023
49eb086
feat(Names): 예외 발생 메시지 추가
homebdy Sep 10, 2023
1812ba3
feat(Menu): 등록된 카테고리별 메뉴 관리
homebdy Sep 10, 2023
efbfa2b
feat(Menu): 카테고리의 전체 메뉴 가져오기
homebdy Sep 10, 2023
465dd49
feat(RecommendMenu): 메뉴 추천 기능 구현
homebdy Sep 10, 2023
9e4fba2
feat(MenuService): 카테고리별 코치 메뉴 추천 기능 구현
homebdy Sep 10, 2023
284dc55
feat(RecommendMenu): 이미 한 번 먹은 음식일 경우 재추천
homebdy Sep 10, 2023
3cd0b3e
fix(ExcludedMenu): 저장 위치 변경
homebdy Sep 10, 2023
148b32c
feat(RecommendMenu): 코치가 못먹는 음식일 경우 재추천
homebdy Sep 10, 2023
5acef53
feat(OutputView): 결과 안내 메시지 출력
homebdy Sep 10, 2023
a03c0ee
feat(OutputView): 추천 요일 출력
homebdy Sep 10, 2023
d1923b9
feat(OutputView): 추천 카테고리 출력
homebdy Sep 10, 2023
1238c62
feat(OutputView): 추천 결과 출력
homebdy Sep 10, 2023
a53173a
feat(OutputView): 추천 완료 안내
homebdy Sep 10, 2023
e1a07ba
docs: 구현 완료 기능 체크
homebdy Sep 10, 2023
f95d828
feat(ExcludedMenu): 못먹는 음식 2개 이상 입력 시 예외 발생
homebdy Sep 10, 2023
89a204d
test(Name): 이름 생성 테스트
homebdy Sep 10, 2023
d61cd32
test(Names): 이름 예외 테스트
homebdy Sep 10, 2023
3b8141d
feat: 예외 발생 지점부터 다시 입력 기능 구현
homebdy Sep 10, 2023
3702089
fix(ExcludedMenu): 못먹는 음식 추가 방식 변경
homebdy Sep 10, 2023
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
Prev Previous commit
Next Next commit
feat(ExcludedMenu): 못 먹는 음식 등록
homebdy committed Sep 10, 2023
commit 0de4f818b0024aff1da0dd62dabf47b4a13f3a2e
2 changes: 1 addition & 1 deletion src/main/java/menu/controller/MenuController.java
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ private void readExcludedFood(Coaches coaches) {
coaches.getCoaches()
.forEach(coach -> {
outputView.printExcludedMenu(coach.getName());
inputView.readExcludedMenu();
coach.addExcludedMenu(inputView.readExcludedMenu());
});
}
}
7 changes: 7 additions & 0 deletions src/main/java/menu/domain/Coach.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
package menu.domain;

import java.util.List;

public class Coach {

private final Name name;
private final ExcludedMenu excludedMenu = new ExcludedMenu();

public Coach(Name name) {
this.name = name;
}

public void addExcludedMenu(List<String> menu) {
excludedMenu.addElements(menu);
}

public String getName() {
return name.getValue();
}
13 changes: 13 additions & 0 deletions src/main/java/menu/domain/ExcludedMenu.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package menu.domain;

import java.util.ArrayList;
import java.util.List;

public class ExcludedMenu {

private final List<String> elements = new ArrayList<>();

public void addElements(List<String> menus) {
elements.addAll(menus);
}
}