-
Notifications
You must be signed in to change notification settings - Fork 1
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
[FIX] 케이크 선물하기 #146
[FIX] 케이크 선물하기 #146
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
지영언니 넘넘 고생하셨습니다~! ! 정말 최고 멋있습니다 최고입니다 ...
public CakeCreateResponseDTO createPresentNew(CakeCreateRequest request) { | ||
val cake = getCake(request.cakeId()); | ||
val wish = wishService.getWish(request.wishId()); | ||
val present = new Present(request.name(), request.message(), wish, cake); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Present는 Builder 패턴을 이용하는 것으로 알고 있는데, builder 패턴을 이용하는건 어떨까요?
Present.builder()
.name(request.name())
.message(request.message())
.wish(wish)
.cake(cake)
.build()
이런느낌으로 생성자 패턴이 통일되면 더 좋을 것 같습니다~!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그렇네요 .. 당장 적용하겠습니다!
@@ -31,4 +31,8 @@ private static LocalDateTime convertToTime(String dateTime) throws DateTimeParse | |||
.atZone(ZoneId.of("Asia/Seoul")); | |||
return LocalDateTime.from(instant); | |||
} | |||
|
|||
public static String calculateContribution(int price, int targetPrice) { | |||
return String.format("%.0f", (double) price / (double) targetPrice * 100); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double은 한쪽에만 붙이고 괄호처리를 하여도 double로 계산이 된다고 알고있습니다!
✨ 관련 이슈
closed #145
✨ 변경 사항 및 이유
✨ PR Point
createPresentNew
라는 함수를 만들었습니다.Util
에 넣었습니다.