Skip to content

Commit

Permalink
Merge pull request #238 from Team-Tiki/chore/#234-member-invitation
Browse files Browse the repository at this point in the history
[CHORE] dto데이터추가
  • Loading branch information
paragon0107 authored Jan 15, 2025
2 parents 5c50c49 + 3b45f6c commit 5d3e970
Showing 1 changed file with 14 additions and 3 deletions.
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()
);
}
}

0 comments on commit 5d3e970

Please sign in to comment.