-
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.
Browse files
Browse the repository at this point in the history
fix: 지원서 상세 정보 조회 api 권한에 따라 분리
- Loading branch information
Showing
64 changed files
with
493 additions
and
524 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
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: 14 additions & 0 deletions
14
src/main/java/com/server/crews/applicant/dto/response/AnswerResponse.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,14 @@ | ||
package com.server.crews.applicant.dto.response; | ||
|
||
import com.server.crews.recruitment.dto.request.QuestionType; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public record AnswerResponse( | ||
Long answerId, | ||
Long questionId, | ||
String content, | ||
Long choiceId, | ||
QuestionType type | ||
) { | ||
} |
42 changes: 8 additions & 34 deletions
42
src/main/java/com/server/crews/applicant/dto/response/ApplicationDetailsResponse.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,40 +1,14 @@ | ||
package com.server.crews.applicant.dto.response; | ||
|
||
import com.server.crews.applicant.domain.Application; | ||
import com.server.crews.applicant.domain.NarrativeAnswer; | ||
import com.server.crews.applicant.domain.SelectiveAnswer; | ||
import lombok.Builder; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public record ApplicationDetailsResponse(Long id, String studentNumber, String major, String name, | ||
List<SelectiveAnswerResponse> selectiveAnswers, | ||
List<NarrativeAnswerResponse> narrativeAnswers) { | ||
|
||
public static ApplicationDetailsResponse of(Application application, List<NarrativeAnswer> narrativeAnswers, | ||
Map<Long, List<SelectiveAnswer>> selectiveAnswers) { | ||
return ApplicationDetailsResponse.builder() | ||
.id(application.getId()) | ||
.studentNumber(application.getStudentNumber()) | ||
.major(application.getMajor()) | ||
.name(application.getName()) | ||
.narrativeAnswers(from(narrativeAnswers)) | ||
.selectiveAnswers(from(selectiveAnswers)) | ||
.build(); | ||
} | ||
|
||
private static List<NarrativeAnswerResponse> from(List<NarrativeAnswer> narrativeAnswers) { | ||
return narrativeAnswers.stream() | ||
.map(NarrativeAnswerResponse::from) | ||
.toList(); | ||
} | ||
|
||
private static List<SelectiveAnswerResponse> from(Map<Long, List<SelectiveAnswer>> selectiveAnswers) { | ||
return selectiveAnswers.entrySet() | ||
.stream() | ||
.map(entry -> SelectiveAnswerResponse.from(entry.getKey(), entry.getValue())) | ||
.toList(); | ||
} | ||
public record ApplicationDetailsResponse( | ||
Long id, | ||
String studentNumber, | ||
String major, | ||
String name, | ||
List<AnswerResponse> answers | ||
) { | ||
} |
18 changes: 7 additions & 11 deletions
18
src/main/java/com/server/crews/applicant/dto/response/ApplicationsResponse.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,18 +1,14 @@ | ||
package com.server.crews.applicant.dto.response; | ||
|
||
import com.server.crews.applicant.domain.Application; | ||
import com.server.crews.applicant.domain.Outcome; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public record ApplicationsResponse(Long id, String studentNumber, String name, String major, Outcome outcome) { | ||
public static ApplicationsResponse from(final Application application) { | ||
return ApplicationsResponse.builder() | ||
.id(application.getId()) | ||
.studentNumber(application.getStudentNumber()) | ||
.name(application.getName()) | ||
.major(application.getMajor()) | ||
.outcome(application.getOutcome()) | ||
.build(); | ||
} | ||
public record ApplicationsResponse( | ||
Long id, | ||
String studentNumber, | ||
String name, | ||
String major, | ||
Outcome outcome | ||
) { | ||
} |
11 changes: 0 additions & 11 deletions
11
src/main/java/com/server/crews/applicant/dto/response/NarrativeAnswerResponse.java
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
src/main/java/com/server/crews/applicant/dto/response/SelectedChoiceResponse.java
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
src/main/java/com/server/crews/applicant/dto/response/SelectiveAnswerResponse.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.