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

Lotto step4 #23

Open
wants to merge 5 commits into
base: pasudo123
Choose a base branch
from
Open

Conversation

pasudo123
Copy link

handlebar.js? 이거 커스텀헬퍼 등록하다가 js 로 잘 안돼길래 시간을 너무 많이 잡아먹었네요.. ㅜ
수정사항이 많긴하지만, 시간이 늦은 관계로 일단 제출 먼저 하겠습니다.ㅜ

잘부탁드립니다.

Copy link

@nokchax nokchax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다.
코멘트 달게 없네요 ㅎ, 궁금한 점만 써봤어요

<tr>
<th>5</th>
<td>[13, 14, 16, 38, 42, 45]</td>
<th>{{@index_1}}</th>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{{@index}}는 알겠는데, {{@index_1}} 은 어떻게 출력되는 건가요??

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nokchax
http://mozmonkey.com/2014/03/ember-getting-the-index-in-each-loops/

handlebars에서 기본으로 지원하는 기능인듯합니다! 저도 처음 보네요... 헬퍼 안만들어도 됐을 걸 그랬네요...ㅠㅠ

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 .... 이런방법이

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 이런 방법도 있군요!

Copy link
Member

@junwoochoi junwoochoi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

잘 보았습니다! 특별히 코멘트 달건없네요 ㅎㅎ 궁금한 부분 몇가지 달아봤습니다

Comment on lines +32 to +35
static {
webConfiguration = new WebConfiguration();
lottoMatchService = new LottoMatchService();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

별건 아닌데 이부분 그냥 처음에 선언할 때

private static WebConfiguration webConfiguration = new WebConfiguration();
private static LottoMatchService lottoMatchService = new LottoMatchService();

이렇게 안하시고 나중에 따로 초기화 하신 이유가 있나요??

post("/buyLotto", (request, response) -> {

final Money money = Won.from(Integer.parseInt(request.queryParamOrDefault("inputMoney", "0")));
final String[] manualNumbers = request.queryParams("manualNumber").split("\r\n");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

매직 문자열 상수로 빼보아요! 저도 안빼긴 했던거 같기도 하네요...ㅎㅎ 😅

Comment on lines +5 to +10
public class WebConfiguration {

static {
port(8080);
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

웹 관련 설정 파일을 빼니까 한곳에서 관리할 수 있어서 더 좋겠네요 👍

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋은 방법이네요 배워갑니다!@

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 이렇게도 깔끔하네요!

Comment on lines +26 to +29
Map<String, Object> model = new HashMap<>();
WinningLottoDto winningLottoDto = lottoResultService.getWinningLottoByResults(money, rankResults);

List<WebWinningLottoDto> webWinningLottoDtos = new ArrayList<>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

final 을 여기서도 사용해도 될 것 같은데 제외하신 이유가 있나요? 👀

Comment on lines +76 to +78
<th>
{{matchCount}} 개 일치{{#if bonus}},보너스 볼 일치{{/if}} ({{money}}원) - {{count}}개
</th>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if 를 사용하는 법이 있었네요 ㅎㅎ 👍

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아.. 전 보너스볼일치 텍스트넣는걸 깜빡했네요 저도 if 사용해서 변경해봐야겠네요

<tr>
<th>5</th>
<td>[13, 14, 16, 38, 42, 45]</td>
<th>{{@index_1}}</th>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nokchax
http://mozmonkey.com/2014/03/ember-getting-the-index-in-each-loops/

handlebars에서 기본으로 지원하는 기능인듯합니다! 저도 처음 보네요... 헬퍼 안만들어도 됐을 걸 그랬네요...ㅠㅠ

Copy link

@wonoh wonoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

깔끔한 코드 잘봤습니다.
index_1 인상적이었어요! 고생하셨습니다

Comment on lines +5 to +10
public class WebConfiguration {

static {
port(8080);
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋은 방법이네요 배워갑니다!@

Comment on lines +76 to +78
<th>
{{matchCount}} 개 일치{{#if bonus}},보너스 볼 일치{{/if}} ({{money}}원) - {{count}}개
</th>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아.. 전 보너스볼일치 텍스트넣는걸 깜빡했네요 저도 if 사용해서 변경해봐야겠네요

Copy link
Member

@cglee079 cglee079 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다!
webConfig를 따로 빼주신것이 인상깊었습니다 👍 !

private long count;

public WebWinningLottoDto(Rank rank, long count){
this.bonus = (rank.name().equalsIgnoreCase("SECOND"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요기는, rank.matchType.isMatchBous를 가져오면 좀더 유연한 대응이 될 수 있을것 같아요!

Comment on lines +5 to +10
public class WebConfiguration {

static {
port(8080);
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 이렇게도 깔끔하네요!

final WinningLotto winningLotto = new WinningLotto(winningLottos, bonusNumber);
final RankResults rankResults = winningLotto.getRankResults(lottos);

Map<String, Object> model = new HashMap<>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

model을 사용하는위치(하단)에서 선언해도 좋을것 같아요!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants