-
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 #3 from Timetris-Trendithon/mainpage
โจ Feat: DTO ์ถ๊ฐ, ErrorStatus enum ์ถ๊ฐ
- Loading branch information
Showing
13 changed files
with
235 additions
and
1 deletion.
There are no files selected for viewing
Empty file.
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
16 changes: 16 additions & 0 deletions
16
src/main/java/com/trendithon/timetris/domain/mainpage/dto/CategoryCreateDTO.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,16 @@ | ||
package com.trendithon.timetris.domain.mainpage.dto; | ||
|
||
import com.trendithon.timetris.domain.login.domain.User; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@AllArgsConstructor @NoArgsConstructor | ||
public class CategoryCreateDTO { | ||
|
||
private String name; | ||
private String colorCode; | ||
private User user; | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/com/trendithon/timetris/domain/mainpage/dto/CategoryViewDTO.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.trendithon.timetris.domain.mainpage.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@AllArgsConstructor @NoArgsConstructor | ||
public class CategoryViewDTO { | ||
|
||
private String name; | ||
private String colorCode; | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/com/trendithon/timetris/domain/mainpage/dto/DoCreateDTO.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,21 @@ | ||
package com.trendithon.timetris.domain.mainpage.dto; | ||
|
||
import com.trendithon.timetris.domain.mainpage.domain.Category; | ||
import com.trendithon.timetris.domain.mainpage.domain.UserDate; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.time.LocalTime; | ||
|
||
@Getter | ||
@AllArgsConstructor @NoArgsConstructor | ||
public class DoCreateDTO { | ||
|
||
private String title; | ||
private LocalTime startTime; | ||
private LocalTime endTime; | ||
private Category category; | ||
private UserDate userDate; | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
src/main/java/com/trendithon/timetris/domain/mainpage/dto/DoViewDTO.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,33 @@ | ||
package com.trendithon.timetris.domain.mainpage.dto; | ||
|
||
import com.trendithon.timetris.domain.mainpage.domain.Category; | ||
import com.trendithon.timetris.domain.mainpage.domain.Date; | ||
import com.trendithon.timetris.domain.mainpage.domain.Do; | ||
import com.trendithon.timetris.domain.mainpage.domain.UserDate; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.time.LocalTime; | ||
|
||
@Getter | ||
@Builder | ||
@AllArgsConstructor @NoArgsConstructor | ||
public class DoViewDTO { | ||
|
||
private String title; | ||
private LocalTime startTime; | ||
private LocalTime endTime; | ||
private Category category; | ||
|
||
public static DoViewDTO of(Do does){ | ||
return DoViewDTO.builder() | ||
.title(does.getTitle()) | ||
.startTime(does.getStartTime()) | ||
.endTime(does.getEndTime()) | ||
.category(does.getCategory()) | ||
.build(); | ||
} | ||
|
||
} |
36 changes: 36 additions & 0 deletions
36
src/main/java/com/trendithon/timetris/domain/mainpage/dto/MainPageDTO.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 com.trendithon.timetris.domain.mainpage.dto; | ||
|
||
import com.trendithon.timetris.domain.mainpage.domain.Do; | ||
import com.trendithon.timetris.domain.mainpage.domain.Plan; | ||
import com.trendithon.timetris.domain.mainpage.domain.See; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
@Getter | ||
@AllArgsConstructor @NoArgsConstructor | ||
public class MainPageDTO { | ||
|
||
List<PlanViewDTO> planViewDTOList; | ||
List<DoViewDTO> doViewDTOList; | ||
List<SeeViewDTO> seeViewDTO; | ||
|
||
public static MainPageDTO from(List<Plan> planList, List<Do> doList, List<See> seeList){ | ||
List<PlanViewDTO> planViewDTOS = planList.stream() | ||
.map(PlanViewDTO::of) | ||
.toList(); | ||
List<DoViewDTO> doViewDTOS = doList.stream() | ||
.map(DoViewDTO::of) | ||
.toList(); | ||
List<SeeViewDTO> seeViewDTO1 = seeList.stream() | ||
.map(SeeViewDTO::of) | ||
.toList(); | ||
|
||
return new MainPageDTO(planViewDTOS, doViewDTOS, seeViewDTO1); | ||
|
||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/com/trendithon/timetris/domain/mainpage/dto/PlanCreateDTO.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,22 @@ | ||
package com.trendithon.timetris.domain.mainpage.dto; | ||
|
||
import com.trendithon.timetris.domain.mainpage.domain.Category; | ||
import com.trendithon.timetris.domain.mainpage.domain.UserDate; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.time.LocalTime; | ||
|
||
@Getter | ||
@AllArgsConstructor @NoArgsConstructor | ||
public class PlanCreateDTO { | ||
|
||
private String title; | ||
private LocalTime startTime; | ||
private LocalTime endTime; | ||
private boolean status; | ||
private Category category; | ||
private UserDate userDate; | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/com/trendithon/timetris/domain/mainpage/dto/PlanViewDTO.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,34 @@ | ||
package com.trendithon.timetris.domain.mainpage.dto; | ||
|
||
import com.trendithon.timetris.domain.mainpage.domain.Category; | ||
import com.trendithon.timetris.domain.mainpage.domain.Plan; | ||
import com.trendithon.timetris.domain.mainpage.domain.UserDate; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.time.LocalTime; | ||
|
||
@Getter | ||
@Builder | ||
@AllArgsConstructor @NoArgsConstructor | ||
public class PlanViewDTO { | ||
|
||
private String title; | ||
private LocalTime startTime; | ||
private LocalTime endTime; | ||
private boolean status; | ||
private Category category; | ||
|
||
public static PlanViewDTO of(Plan plan){ | ||
return PlanViewDTO.builder() | ||
.title(plan.getTitle()) | ||
.startTime(plan.getStartTime()) | ||
.endTime(plan.getEndTime()) | ||
.status(plan.isStatus()) | ||
.category(plan.getCategory()) | ||
.build(); | ||
} | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/com/trendithon/timetris/domain/mainpage/dto/SeeCreateDTO.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,15 @@ | ||
package com.trendithon.timetris.domain.mainpage.dto; | ||
|
||
import com.trendithon.timetris.domain.mainpage.domain.UserDate; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@AllArgsConstructor @NoArgsConstructor | ||
public class SeeCreateDTO { | ||
|
||
private String content; | ||
private UserDate userDate; | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/com/trendithon/timetris/domain/mainpage/dto/SeeViewDTO.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,25 @@ | ||
package com.trendithon.timetris.domain.mainpage.dto; | ||
|
||
import com.trendithon.timetris.domain.mainpage.domain.Date; | ||
import com.trendithon.timetris.domain.mainpage.domain.See; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.Optional; | ||
|
||
@Getter | ||
@Builder | ||
@AllArgsConstructor @NoArgsConstructor | ||
public class SeeViewDTO { | ||
|
||
private String content; | ||
|
||
public static SeeViewDTO of(See see){ | ||
return SeeViewDTO.builder() | ||
.content(see.getContent()) | ||
.build(); | ||
} | ||
|
||
} |
Empty file.
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