-
Notifications
You must be signed in to change notification settings - Fork 5
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
[BE] 지출 내역 생성 및 현재 참여 인원 조회 예외 메시지 변경 #100
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ | |
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import server.haengdong.exception.HaengdongErrorCode; | ||
import server.haengdong.exception.HaengdongException; | ||
|
||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
|
@@ -45,13 +47,15 @@ public BillAction(Action action, String title, Long price) { | |
private void validateTitle(String title) { | ||
int titleLength = title.trim().length(); | ||
if (titleLength < MIN_TITLE_LENGTH || titleLength > MAX_TITLE_LENGTH) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 저도 이 부분은 망쵸의 의견과 같네요. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
이건 동의하는데 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 제가 처음 들었던 예시를 뒤집어서 했군요. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. !(10 < A && A < 20) 은 어떤가요? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 개인적으로 부등호 방향이 같은 게 인지하기 쉽다고 생각해요! |
||
throw new IllegalArgumentException("앞뒤 공백을 제거한 지출 내역 제목은 2 ~ 30자여야 합니다."); | ||
throw new HaengdongException(HaengdongErrorCode.BAD_REQUEST, | ||
String.format("앞뒤 공백을 제거한 지출 내역 제목은 %d ~ %d자여야 합니다.", MIN_TITLE_LENGTH, MAX_TITLE_LENGTH)); | ||
} | ||
} | ||
|
||
private void validatePrice(Long price) { | ||
if (price < MIN_PRICE || price > MAX_PRICE) { | ||
throw new IllegalArgumentException("지출 금액은 10,000,000 이하의 자연수여야 합니다."); | ||
throw new HaengdongException(HaengdongErrorCode.BAD_REQUEST, | ||
String.format("지출 금액은 %,d 이하의 자연수여야 합니다.", MAX_PRICE)); | ||
} | ||
} | ||
|
||
|
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.
c: 제안해 봅니다
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.
길이가 최소값보다 작거나 길이가 최대값보다 크거나
로 읽는 것이 자연스러워 보여 기각합니다.