-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[CHORE] dto데이터추가
- Loading branch information
Showing
1 changed file
with
14 additions
and
3 deletions.
There are no files selected for viewing
17 changes: 14 additions & 3 deletions
17
...main/java/com/tiki/server/timeblock/service/dto/response/TimeBlockTagServiceResponse.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 |
---|---|---|
@@ -1,16 +1,27 @@ | ||
package com.tiki.server.timeblock.service.dto.response; | ||
|
||
import com.tiki.server.timeblock.entity.BlockType; | ||
import com.tiki.server.timeblock.entity.TimeBlock; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
|
||
import java.time.LocalDate; | ||
|
||
public record TimeBlockTagServiceResponse( | ||
@NotNull long id, | ||
@NotNull String name, | ||
@NotNull String color | ||
@NotNull String color, | ||
@NotNull BlockType blockType, | ||
@NotNull LocalDate startDate | ||
) { | ||
|
||
public static TimeBlockTagServiceResponse from(final TimeBlock timeBlock){ | ||
return new TimeBlockTagServiceResponse(timeBlock.getId(), timeBlock.getName(), timeBlock.getColor()); | ||
public static TimeBlockTagServiceResponse from(final TimeBlock timeBlock) { | ||
return new TimeBlockTagServiceResponse( | ||
timeBlock.getId(), | ||
timeBlock.getName(), | ||
timeBlock.getColor(), | ||
timeBlock.getType(), | ||
timeBlock.getStartDate() | ||
); | ||
} | ||
} |