-
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.
[#48]
- Loading branch information
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
src/main/java/com/careerzip/global/admin/dto/response/AdminQuestionPaperDetail.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,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(); | ||
} | ||
} |