Skip to content

Commit

Permalink
Merge pull request #31 from Timetris-Trendithon/mainpage
Browse files Browse the repository at this point in the history
🎨Style: λ©”μΈνŽ˜μ΄μ§€μ—μ„œ ν•„μš”ν•œ μ‹œκ°„ μš”μ†Œλ§Œ return
  • Loading branch information
Zena0128 authored Feb 22, 2024
2 parents 2021c48 + f5b59b2 commit 2133d74
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.trendithon.timetris.domain.mainpage.dto;

import com.trendithon.timetris.domain.mainpage.domain.Do;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.time.LocalTime;

@Getter
@Builder
@AllArgsConstructor @NoArgsConstructor
public class DoTimeDTO {

private int hour;
private int minute;

public static DoTimeDTO of(LocalTime localTime){
return DoTimeDTO.builder()
.hour(localTime.getHour())
.minute(localTime.getMinute())
.build();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ public class DoViewDTO {

private long id;
private String title;
private LocalTime startTime;
private LocalTime endTime;
private DoTimeDTO startTime;
private DoTimeDTO endTime;
private CategoryViewDTO category;

public static DoViewDTO of(Do does){
return DoViewDTO.builder()
.id(does.getId())
.title(does.getTitle())
.startTime(does.getStartTime())
.endTime(does.getEndTime())
.startTime(DoTimeDTO.of(does.getStartTime()))
.endTime(DoTimeDTO.of(does.getEndTime()))
.category(CategoryViewDTO.of(does.getCategory()))
.build();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.trendithon.timetris.domain.mainpage.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.time.LocalTime;

@Getter
@Builder
@AllArgsConstructor @NoArgsConstructor
public class PlanTimeDTO {

private int hour;

public static PlanTimeDTO of(LocalTime localTime){
return PlanTimeDTO.builder()
.hour(localTime.getHour())
.build();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ public class PlanViewDTO {

private long id;
private String title;
private LocalTime startTime;
private LocalTime endTime;
private PlanTimeDTO startTime;
private PlanTimeDTO endTime;
private boolean status;
private CategoryViewDTO category;

public static PlanViewDTO of(Plan plan){
return PlanViewDTO.builder()
.id(plan.getId())
.title(plan.getTitle())
.startTime(plan.getStartTime())
.endTime(plan.getEndTime())
.startTime(PlanTimeDTO.of(plan.getStartTime()))
.endTime(PlanTimeDTO.of(plan.getEndTime()))
.status(plan.isStatus())
.category(CategoryViewDTO.of(plan.getCategory()))
.build();
Expand Down

0 comments on commit 2133d74

Please sign in to comment.