-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
๐ฉน [STMT-62] ์คํฐ๋ ๋๋ฉ์ธ ๋๋ฝ๋ ์ปฌ๋ผ๋ค ์ถ๊ฐ (#109)
* ๐ฉน [STMT-62] ์คํฐ๋ ๋๋ฉ์ธ ๋๋ฝ๋ ์ปฌ๋ผ ์ถ๊ฐ - ์ ๊ธฐ๋ชจ์ ์๊ฐ - ์ ๊ธฐ๋ชจ์ ๋ฐ๋ณต * ๐ฉน [STMT-62] ์คํฐ๋ ์์ธ ์ ๋ณด ์กฐํ api - ๋๋ฝ๋ ์ ๋ณด ๋ฐํ ์๋ต์ ์ถ๊ฐ * ๐ฉน [STMT-62] sql - table `study` ddl ์์ ๋ฐ dummy data ์์ * ๐ง [STMT-62] ๋ฆฌ๋ทฐ๋ฐ์: ํด๋์ค ๋จ์ ํธ๋์ญ์ ์ด๋ ธํ ์ด์ ์ถ๊ฐ * ๐ง [STMT-62] ๋ฆฌ๋ทฐ๋ฐ์: ๋ชจ์ ๋ฐ๋ณต mapping ๋ก์ง mapper์ ์์ - repeat๋ ํ๋ฒ ๋ฐ๋ณต ํ๋ค๋ ์๋ฏธ๊ฐ ์์ด ๋ช ์ฌํ์ ์ฌ๋ฌ๋ฒ ๋ฐ๋ณตํ๋ค๋ ๋ป์ ๊ฐ์ง repetition์ผ๋ก ํด๋์ค๋ช ๋ณ๊ฒฝ - MeetingRepetitionPersistenceMapper ํด๋์ค๋ฅผ ๊ตฌํํ์ฌ ํด๋น ํด๋์ค์์ Repetition์ mappingํ๋ ๋ก์ง ๊ตฌํ * ๐จ [STMT-62] StudyPersistenceMapper ์ฝ๋ ํฌ๋งทํ * ๐จ [STMT-62] StudyPersistenceMapper ์ฌํฌ๋งทํ * ๐ฉน [STMT-62] ์ปฌ๋ผ ์ถ๊ฐ์ ๋ฐ๋ฅธ ์คํฐ๋ ์์ธ ์ ๋ณด ์๋ต์ ์ถ๊ฐ * โ [STMT-62] ์คํฐ๋ ์์ธ ์ ๋ณด ๊ฐ์ ธ์ค๊ธฐ api test ์์
- Loading branch information
Showing
12 changed files
with
154 additions
and
23 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
28 changes: 28 additions & 0 deletions
28
...umeet/server/study/adapter/out/persistance/mapper/MeetingRepetitionPersistenceMapper.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.stumeet.server.study.adapter.out.persistance.mapper; | ||
|
||
import java.util.List; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
import com.stumeet.server.study.domain.ScheduleRepetitionType; | ||
import com.stumeet.server.study.domain.StudyMeetingSchedule; | ||
|
||
@Component | ||
public class MeetingRepetitionPersistenceMapper { | ||
|
||
private static final String REPEAT_DELIMITER = ";"; | ||
|
||
public StudyMeetingSchedule.Repetition toDomain(String meetingRepetition) { | ||
List<String> repetitionElements = List.of(meetingRepetition.split(REPEAT_DELIMITER)); | ||
|
||
return StudyMeetingSchedule.Repetition.of( | ||
ScheduleRepetitionType.valueOf(repetitionElements.getFirst()), | ||
repetitionElements.subList(1, repetitionElements.size())); | ||
} | ||
|
||
public String toColumn(StudyMeetingSchedule.Repetition repetition) { | ||
return repetition.getType().toString() | ||
+ REPEAT_DELIMITER | ||
+ String.join(REPEAT_DELIMITER, repetition.getDates()); | ||
} | ||
} |
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
14 changes: 14 additions & 0 deletions
14
src/main/java/com/stumeet/server/study/domain/ScheduleRepetitionType.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,14 @@ | ||
package com.stumeet.server.study.domain; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
|
||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
public enum ScheduleRepetitionType { | ||
|
||
DAILY("๋งค์ผ"), | ||
WEEKLY("๋งค์ฃผ"), | ||
MONTHLY("๋งค๋ฌ"); | ||
|
||
private final String name; | ||
} |
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
41 changes: 41 additions & 0 deletions
41
src/main/java/com/stumeet/server/study/domain/StudyMeetingSchedule.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,41 @@ | ||
package com.stumeet.server.study.domain; | ||
|
||
import java.time.LocalTime; | ||
import java.util.List; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
@Getter | ||
public class StudyMeetingSchedule { | ||
|
||
private final LocalTime time; | ||
private final Repetition repetition; | ||
|
||
@Getter | ||
@AllArgsConstructor(staticName = "of") | ||
public static class Repetition { | ||
|
||
private final ScheduleRepetitionType type; | ||
|
||
private final List<String> dates; | ||
} | ||
|
||
public static StudyMeetingSchedule of(LocalTime time, Repetition repetition) { | ||
return new StudyMeetingSchedule(time, repetition); | ||
} | ||
|
||
public LocalTime getTime() { | ||
return time; | ||
} | ||
|
||
public ScheduleRepetitionType getRepetitionType() { | ||
return repetition.getType(); | ||
} | ||
|
||
public List<String> getRepetitionDates() { | ||
return repetition.getDates(); | ||
} | ||
} |
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
5 changes: 3 additions & 2 deletions
5
src/main/resources/db/migration/V1.6__insert_study_dummy_data.sql
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