Skip to content

Commit

Permalink
Merge pull request #132 from Link-MIND/test
Browse files Browse the repository at this point in the history
[Merge] json decode ์—๋Ÿฌ ํ•ด๊ฒฐ ํ›„ merge
  • Loading branch information
mmihye committed Jan 17, 2024
2 parents 579ea20 + 83e7bea commit e421c0a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions linkmind/src/main/java/com/app/toaster/exception/Error.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public enum Error {
REQUEST_METHOD_VALIDATION_EXCEPTION(HttpStatus.BAD_REQUEST, "์ž˜๋ชป๋œ ๋ฉ”์†Œ๋“œ์ž…๋‹ˆ๋‹ค."),
REQUEST_MEDIA_TYPE_VALIDATION_EXCEPTION(HttpStatus.BAD_REQUEST, "๋ฏธ๋””์–ด ํƒ€์ž…์„ ํ™•์ธํ•ด์ฃผ์„ธ์š”."),
BAD_REQUEST_URL(HttpStatus.BAD_REQUEST, "์ฃ„์†กํ•ฉ๋‹ˆ๋‹ค. ์ดํ•ดํ•  ์ˆ˜ ์—†๋Š” url์ž…๋‹ˆ๋‹ค."),
BAD_REQUEST_CREATE_TIMER_EXCEPTION(HttpStatus.BAD_REQUEST, "ํƒ€์ด๋จธ๋Š” ์ตœ๋Œ€ 5๊ฐœ๊นŒ์ง€๋งŒ ๋“ฑ๋ก๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
BAD_REQUEST_CREATE_CLIP_EXCEPTION(HttpStatus.BAD_REQUEST, "ํด๋ฆฝ์€ ์ตœ๋Œ€ 15๊ฐœ๊นŒ์ง€๋งŒ ๋“ฑ๋ก๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),

/**
* 401 UNAUTHORIZED EXCEPTION
Expand All @@ -52,9 +54,7 @@ public enum Error {
* 422 UNPROCESSABLE_ENTITY
*/
UNPROCESSABLE_ENTITY_DELETE_EXCEPTION(HttpStatus.UNPROCESSABLE_ENTITY, "์„œ๋ฒ„์—์„œ ์š”์ฒญ์„ ์ดํ•ดํ•ด ์‚ญ์ œํ•˜๋ ค๋Š” ๋„์ค‘ ๋ฌธ์ œ๊ฐ€ ์ƒ๊ฒผ์Šต๋‹ˆ๋‹ค."),
UNPROCESSABLE_ENTITY_CREATE_TIMER_EXCEPTION(HttpStatus.UNPROCESSABLE_ENTITY, "ํƒ€์ด๋จธ๋Š” ์ตœ๋Œ€ 5๊ฐœ๊นŒ์ง€๋งŒ ๋“ฑ๋ก๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
UNPROCESSABLE_CREATE_TIMER_EXCEPTION(HttpStatus.UNPROCESSABLE_ENTITY, "์ด๋ฏธ ํƒ€์ด๋จธ๊ฐ€ ์กด์žฌํ•˜๋Š” ํด๋ฆฝ์ž…๋‹ˆ๋‹ค."),
UNPROCESSABLE_ENTITY_CREATE_CLIP_EXCEPTION(HttpStatus.UNPROCESSABLE_ENTITY, "ํด๋ฆฝ์€ ์ตœ๋Œ€ 50๊ฐœ๊นŒ์ง€๋งŒ ๋“ฑ๋ก๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค."),
UNPROCESSABLE_PRESIGNEDURL_EXCEPTION(HttpStatus.UNPROCESSABLE_ENTITY, "presignedUrl ๋ฐœ๊ธ‰ ์ค‘ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค."),
UNPROCESSABLE_KAKAO_SERVER_EXCEPTION(HttpStatus.UNPROCESSABLE_ENTITY, "์นด์นด์˜ค์„œ๋ฒ„์™€ ํ†ต์‹  ์ค‘ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค."),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void createCategory(final Long userId, final CreateCategoryDto createCate
val categoryNum= categoryRepository.findAllByUser(presentUser).size();

if(categoryNum > MAX_CATERGORY_NUMBER){
throw new CustomException(Error.UNPROCESSABLE_ENTITY_CREATE_CLIP_EXCEPTION, Error.UNPROCESSABLE_ENTITY_CREATE_CLIP_EXCEPTION.getMessage());
throw new CustomException(Error.BAD_REQUEST_CREATE_CLIP_EXCEPTION, Error.BAD_REQUEST_CREATE_CLIP_EXCEPTION.getMessage());
}

//์นดํ…Œ๊ณ ๋ฆฌ ์ƒ์„ฑ
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ public void createTimer(Long userId, CreateTimerRequestDto createTimerRequestDto

int timerNum = timerRepository.findAllByUser(presentUser).size();

if(timerNum>=MaxTimerNumber){
throw new CustomException(Error.UNPROCESSABLE_ENTITY_CREATE_TIMER_EXCEPTION, Error.UNPROCESSABLE_ENTITY_CREATE_TIMER_EXCEPTION.getMessage());
if(timerNum>MaxTimerNumber){
throw new CustomException(Error.BAD_REQUEST_CREATE_TIMER_EXCEPTION, Error.BAD_REQUEST_CREATE_TIMER_EXCEPTION.getMessage());
}

if(createTimerRequestDto.categoryId() != 0) {
Expand Down Expand Up @@ -218,17 +218,17 @@ private boolean isCompletedTimer(Reminder reminder){

// ์™„๋ฃŒ๋œ ํƒ€์ด๋จธ ๋‚ ์งœ,์‹œ๊ฐ„ ํฌ๋งท
private CompletedTimerDto createCompletedTimerDto(Reminder reminder) {
String time = reminder.getRemindTime().format(DateTimeFormatter.ofPattern("a hh:mm"));
String date = LocalDateTime.now().format(DateTimeFormatter.ofPattern("E์š”์ผ"));
String time = reminder.getRemindTime().format(DateTimeFormatter.ofPattern("a hh:mm",locale));
String date = LocalDateTime.now().format(DateTimeFormatter.ofPattern("E์š”์ผ",locale));
return CompletedTimerDto.of(reminder, time, date);
}

// ๋Œ€๊ธฐ์ค‘์ธ ํƒ€์ด๋จธ ๋‚ ์งœ,์‹œ๊ฐ„ ํฌ๋งท
private WaitingTimerDto createWaitingTimerDto(Reminder reminder) {
LocalDateTime now = LocalDateTime.now();
String time = (reminder.getRemindTime().getMinute() == 0)
? reminder.getRemindTime().format(DateTimeFormatter.ofPattern("a h์‹œ"))
: reminder.getRemindTime().format(DateTimeFormatter.ofPattern("a h์‹œ mm๋ถ„"));
? reminder.getRemindTime().format(DateTimeFormatter.ofPattern("a h์‹œ",locale))
: reminder.getRemindTime().format(DateTimeFormatter.ofPattern("a h์‹œ mm๋ถ„",locale));

String dates = reminder.getRemindDates().stream()
.map(this::mapIndexToDayString)
Expand All @@ -240,7 +240,7 @@ private WaitingTimerDto createWaitingTimerDto(Reminder reminder) {
// ์ธ๋ฑ์Šค๋กœ ์š”์ผ ์•Œ์•„๋‚ด๊ธฐ
private String mapIndexToDayString(int index) {
DayOfWeek dayOfWeek = DayOfWeek.of(index);
String dayName = dayOfWeek.getDisplayName(java.time.format.TextStyle.FULL, Locale.getDefault());
String dayName = dayOfWeek.getDisplayName(java.time.format.TextStyle.FULL, locale);

return dayName.substring(0, 1);
}
Expand Down

0 comments on commit e421c0a

Please sign in to comment.