-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from DSM-Repo/document-search
pr: 학생 문제 목록 조회에서 피드백 반환
- Loading branch information
Showing
3 changed files
with
41 additions
and
11 deletions.
There are no files selected for viewing
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
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
14 changes: 11 additions & 3 deletions
14
src/main/java/com/example/whopper/interfaces/resume/dto/response/SearchDocumentResponse.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,24 @@ | ||
package com.example.whopper.interfaces.resume.dto.response; | ||
|
||
import com.example.whopper.domain.feedback.FeedbackEntity; | ||
import com.example.whopper.domain.resume.DocumentEntity; | ||
import com.example.whopper.domain.resume.element.DocumentStatus; | ||
import com.example.whopper.domain.student.StudentInfo; | ||
|
||
import java.util.List; | ||
|
||
public record SearchDocumentResponse( | ||
String documentId, | ||
StudentInfo studentInfo, | ||
DocumentStatus status, | ||
int numberOfFeedback | ||
List<Feedback> feedbackList | ||
) { | ||
public static SearchDocumentResponse of(DocumentEntity document, int numberOfFeedback) { | ||
return new SearchDocumentResponse(document.getId(), StudentInfo.of(document.getStudent()), document.getStatus(), numberOfFeedback); | ||
public record Feedback(String id, String comment, String type, String status, boolean rejected) { | ||
public static Feedback fromFeedback(FeedbackEntity feedback) { | ||
return new Feedback(feedback.getId(), feedback.getComment(), feedback.getType().name(), feedback.getStatus().name(), feedback.getRejected()); | ||
} | ||
} | ||
public static SearchDocumentResponse of(DocumentEntity document, List<Feedback> feedbackList) { | ||
return new SearchDocumentResponse(document.getId(), StudentInfo.of(document.getStudent()), document.getStatus(), feedbackList); | ||
} | ||
} |