-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #163 from 9oormthon-univ/fix/storeDetail
Fix/store detail
- Loading branch information
Showing
8 changed files
with
113 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/main/java/com/jangburich/utils/DayOfWeekConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.jangburich.utils; | ||
|
||
import java.time.DayOfWeek; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
public class DayOfWeekConverter { | ||
|
||
public static DayOfWeek convertKoreanToDayOfWeek(String koreanDay) { | ||
return switch (koreanDay.trim()) { | ||
case "์" -> DayOfWeek.MONDAY; | ||
case "ํ" -> DayOfWeek.TUESDAY; | ||
case "์" -> DayOfWeek.WEDNESDAY; | ||
case "๋ชฉ" -> DayOfWeek.THURSDAY; | ||
case "๊ธ" -> DayOfWeek.FRIDAY; | ||
case "ํ " -> DayOfWeek.SATURDAY; | ||
case "์ผ" -> DayOfWeek.SUNDAY; | ||
default -> throw new IllegalArgumentException("Invalid day: " + koreanDay); | ||
}; | ||
} | ||
|
||
public static List<DayOfWeek> convertStringToDayOfWeekList(String daysString) { | ||
return Arrays.stream(daysString.split(",")) | ||
.map(DayOfWeekConverter::convertKoreanToDayOfWeek) | ||
.collect(Collectors.toList()); | ||
} | ||
} |