Skip to content

Commit

Permalink
Feat: 질문지 조회 DTO 추가
Browse files Browse the repository at this point in the history
[#48]
  • Loading branch information
MuseopKim committed Jun 28, 2021
1 parent e27e810 commit 8be5f2a
Showing 1 changed file with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package com.careerzip.global.admin.dto.response;

import com.careerzip.domain.questionpaper.entity.QuestionPaper;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Builder;
import lombok.Getter;

import java.time.LocalDateTime;

@Getter
public class AdminQuestionPaperDetail {

private final long id;

private final String title;

@JsonFormat(pattern = "yyyy-MM-dd")
private final LocalDateTime startDateTime;

@JsonFormat(pattern = "yyyy-MM-dd")
private final LocalDateTime endDateTime;

@JsonFormat(pattern = "yyyy-MM-dd")
private final LocalDateTime finishDateTime;

private final boolean opened;

@Builder
private AdminQuestionPaperDetail(long id, String title, LocalDateTime startDateTime, LocalDateTime endDateTime,
LocalDateTime finishDateTime, boolean opened) {
this.id = id;
this.title = title;
this.startDateTime = startDateTime;
this.endDateTime = endDateTime;
this.finishDateTime = finishDateTime;
this.opened = opened;
}

public static AdminQuestionPaperDetail from(QuestionPaper questionPaper) {
return AdminQuestionPaperDetail.builder()
.id(questionPaper.getId())
.title(questionPaper.getTitle())
.startDateTime(questionPaper.getStartDateTime())
.endDateTime(questionPaper.getEndDateTime())
.opened(questionPaper.getOpened())
.build();
}
}

0 comments on commit 8be5f2a

Please sign in to comment.