-
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.
Merge pull request #25 from hanium-haemil/feature/new_schedule
[REFACTOR] schedule api
- Loading branch information
Showing
8 changed files
with
122 additions
and
68 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
35 changes: 35 additions & 0 deletions
35
src/main/java/com/haemil/backend/schedule/dto/ScheduleRequestDto.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,35 @@ | ||
package com.haemil.backend.schedule.dto; | ||
|
||
import com.haemil.backend.schedule.entity.RepeatType; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.time.DayOfWeek; | ||
import java.time.LocalDate; | ||
import java.time.LocalTime; | ||
|
||
//schedule에 데이터를 넣을 때의 입력 요청 값을 받음 | ||
@NoArgsConstructor | ||
@Getter | ||
public class ScheduleRequestDto { | ||
|
||
private Long id; | ||
|
||
private LocalDate localDate; | ||
|
||
private DayOfWeek dayOfWeek; | ||
|
||
private LocalTime time; | ||
|
||
private String content; | ||
|
||
private Boolean done; | ||
|
||
private String place; | ||
|
||
private String medicine; | ||
|
||
private RepeatType repeatType; | ||
|
||
|
||
} |
63 changes: 63 additions & 0 deletions
63
src/main/java/com/haemil/backend/schedule/dto/ScheduleResponseDto.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,63 @@ | ||
package com.haemil.backend.schedule.dto; | ||
|
||
import com.haemil.backend.schedule.entity.RepeatType; | ||
import com.haemil.backend.schedule.entity.Schedule; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
import java.time.DayOfWeek; | ||
import java.time.LocalDate; | ||
import java.time.LocalTime; | ||
|
||
//schedule에서 값을 가져올 때 직접적인 entity 대신 앞에 써줌 | ||
//클라이언트에게 응답할 때 필요한 속성들 추가 | ||
@NoArgsConstructor | ||
@Getter | ||
@Setter | ||
public class ScheduleResponseDto { | ||
|
||
private String mapUrl; | ||
|
||
private Long id; | ||
|
||
private LocalDate localDate; | ||
|
||
private DayOfWeek dayOfWeek; | ||
|
||
private LocalTime time; | ||
|
||
private String content; | ||
|
||
private String place; | ||
|
||
private Boolean done; | ||
|
||
private String medicine; | ||
|
||
private RepeatType repeatType; | ||
|
||
|
||
public ScheduleResponseDto(Schedule schedule){ | ||
this.mapUrl = schedule.getMapUrl(); | ||
|
||
this.id = schedule.getId(); | ||
|
||
this.localDate = schedule.getLocalDate(); | ||
|
||
this.dayOfWeek = schedule.getDayOfWeek(); | ||
|
||
this.time = schedule.getTime(); | ||
|
||
this.content = schedule.getContent(); | ||
|
||
this.place = schedule.getPlace(); | ||
|
||
this.done = schedule.getDone(); | ||
|
||
this.medicine = schedule.getMedicine(); | ||
|
||
this.repeatType = schedule.getRepeatType(); | ||
|
||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/com/haemil/backend/schedule/entity/RepeatType.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,9 @@ | ||
package com.haemil.backend.schedule.entity; | ||
|
||
|
||
public enum RepeatType { | ||
DAILY, | ||
WEEKLY, | ||
MONTHLY, | ||
NONE | ||
} |
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