-
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.
- Loading branch information
Showing
5 changed files
with
86 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package org.sopt.app.domain.enums; | ||
|
||
public enum CalendarType { | ||
EVENT, SEMINAR | ||
EVENT, SEMINAR, ETC | ||
} |
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
36 changes: 36 additions & 0 deletions
36
src/main/java/org/sopt/app/presentation/calendar/RecentCalendarResponse.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,36 @@ | ||
package org.sopt.app.presentation.calendar; | ||
|
||
import java.time.LocalDate; | ||
import java.time.format.DateTimeFormatter; | ||
import lombok.Getter; | ||
import org.sopt.app.domain.entity.Calendar; | ||
import org.sopt.app.domain.enums.CalendarType; | ||
|
||
@Getter | ||
public class RecentCalendarResponse{ | ||
private final String date; | ||
private final CalendarType type; | ||
private final String title; | ||
|
||
public static RecentCalendarResponse of(Calendar calendar){ | ||
return new RecentCalendarResponse( | ||
calendar.getStartDate(), | ||
calendar.getType(), | ||
calendar.getTitle() | ||
); | ||
} | ||
|
||
public static RecentCalendarResponse createEmptyCalendar(LocalDate date){ | ||
return new RecentCalendarResponse( | ||
date, | ||
CalendarType.ETC, | ||
"일정이 없습니다." | ||
); | ||
} | ||
|
||
private RecentCalendarResponse(final LocalDate date, final CalendarType type, final String title){ | ||
this.date = date.format(DateTimeFormatter.ofPattern("MM-dd")); | ||
this.type = type; | ||
this.title = title; | ||
} | ||
} |