-
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 #64 from team-Ollie/develop
[develop]
- Loading branch information
Showing
7 changed files
with
78 additions
and
16 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
54 changes: 54 additions & 0 deletions
54
src/main/java/ollie/wecare/program/dto/GetProgramDetailRes.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,54 @@ | ||
package ollie.wecare.program.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import ollie.wecare.program.entity.Program; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@Builder | ||
@NoArgsConstructor | ||
public class GetProgramDetailRes { | ||
|
||
|
||
private Long programIdx; | ||
|
||
private String name; | ||
|
||
private DateDto openDate; | ||
|
||
private DateDto dueDate; | ||
|
||
private String location; | ||
|
||
private String host; | ||
|
||
private String schedule; | ||
|
||
private String description; | ||
|
||
|
||
public static GetProgramDetailRes fromProgram(Program program) { | ||
return GetProgramDetailRes.builder() | ||
.programIdx(program.getProgramIdx()) | ||
.name(program.getName()) | ||
.openDate(convertToDateDto(program.getOpenDate())) | ||
.dueDate(convertToDateDto(program.getDueDate())) | ||
.location(program.getLocation()) | ||
.host(program.getHost()) | ||
.schedule(program.getSchedule()) | ||
.description(program.getDescription()).build(); | ||
} | ||
|
||
private static DateDto convertToDateDto(LocalDateTime dueDate) { | ||
if (dueDate == null) return null; | ||
return new DateDto( | ||
dueDate.getYear(), | ||
dueDate.getMonthValue(), | ||
dueDate.getDayOfMonth()); | ||
} | ||
} |
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