Skip to content

고등학생 질문 글 태그 관련 응답 및 요청 DTO 수정 #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public static HighSchoolStudentQuestion toHighSchoolStudentQuestion(
CreateHighSchoolStudentQuestionRequest request,
HighSchoolStudent highSchoolStudent
) {
String universityNameTag = request.universityNameTag() == null || request.universityNameTag().isBlank()
? "DEFAULT"
: request.universityNameTag();
UniversityMajorCategory universityMajorTag = request.universityMajorTag() == null
? UniversityMajorCategory.DEFAULT
: request.universityMajorTag();
Expand All @@ -47,7 +50,7 @@ public static HighSchoolStudentQuestion toHighSchoolStudentQuestion(
.title(request.title())
.question(request.question())
.highSchoolStudent(highSchoolStudent)
.universityNameTag(request.universityNameTag())
.universityNameTag(universityNameTag)
.universityGradeTag(universityGradeTag)
.universityMajorTag(universityMajorTag)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,25 @@ public record CreateHighSchoolStudentQuestionResponse(
String title,

@Schema(description = "고등학생 질문 내용", example = "12344로 해당 대학에 입학할 수 있을까요?")
String question
String question,

@Schema(description = "질문글에서 답변을 원하는 대학생의 학교명")
String universityNameTag,

@Schema(description = "질문글에서 답변을 원하는 대학생의 학과")
String universityMajorTag,

@Schema(description = "질문글에서 답변을 원하는 대학생의 학년")
String universityGradeTag
) {
public static CreateHighSchoolStudentQuestionResponse from(HighSchoolStudentQuestion highSchoolStudentQuestion) {
return CreateHighSchoolStudentQuestionResponse.builder()
.highSchoolStudentQuestionId(highSchoolStudentQuestion.getId())
.title(highSchoolStudentQuestion.getTitle())
.question(highSchoolStudentQuestion.getQuestion())
.universityNameTag(highSchoolStudentQuestion.getUniversityNameTag())
.universityMajorTag(highSchoolStudentQuestion.getUniversityMajorTag().getValue())
.universityGradeTag(highSchoolStudentQuestion.getUniversityGradeTag().getValue())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ public record DetailHighSchoolStudentQuestionResponse(
@Schema(description = "고등학생 질문 내용", example = "이번에 모의고사 성적이 나왔는데, 이 성적으로 어떤 대학을 갈수 있을까요?")
String question,

@Schema(description = "고등학생 질문에서 답변을 원하는 대학생의 학교명", example = "단국대학교")
String universityNameTag,

@Schema(description = "고등학생 질문에서 답변을 원하는 대학생의 학과", example = "컴퓨터/SW")
String universityMajorTag,

@Schema(description = "고등학생 질문에서 답변을 원하는 대학생의 학년", example = "1학년")
String universityGradeTag,

@Schema(description = "고등학생 질문에 대한 좋아요 수", example = "3")
Long likeCount,

Expand Down Expand Up @@ -51,6 +60,9 @@ public static DetailHighSchoolStudentQuestionResponse of(
.highSchoolStudentNickname(highSchoolStudentQuestion.getHighSchoolStudent().getNickname())
.title(highSchoolStudentQuestion.getTitle())
.question(highSchoolStudentQuestion.getQuestion())
.universityNameTag(highSchoolStudentQuestion.getUniversityNameTag())
.universityMajorTag(highSchoolStudentQuestion.getUniversityMajorTag().getValue())
.universityGradeTag(highSchoolStudentQuestion.getUniversityGradeTag().getValue())
.likeCount(highSchoolStudentQuestion.getLikeCount())
.awnserCount(highSchoolStudentQuestion.getAnswerCount())
.highSchoolStudentQuestionMediaUrls(highSchoolStudentQuestionMediaUrls)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,25 @@ public record RecommendationHighSchoolStudentQuestionResponse(
String title,

@Schema(description = "매칭된 고등학생 질문글 내용", example = "현재 수능 23225 입니다.")
String question
String question,

@Schema(description = "매칭된 고등학생 질문글에서 답변을 원하는 대학생의 학교명", example = "단국대학교")
String universityNameTag,

@Schema(description = "매칭된 고등학생 질문글에서 답변을 원하는 대학생의 학과", example = "컴퓨터/SW")
String universityMajorTag,

@Schema(description = "매칭된 고등학생 질문글에서 답변을 원하는 대학생의 학년", example = "1학년")
String universityGradeTag
) {
public static RecommendationHighSchoolStudentQuestionResponse from(HighSchoolStudentQuestion highSchoolStudentQuestion) {
return RecommendationHighSchoolStudentQuestionResponse.builder()
.id(highSchoolStudentQuestion.getId())
.title(highSchoolStudentQuestion.getTitle())
.question(highSchoolStudentQuestion.getQuestion())
.universityNameTag(highSchoolStudentQuestion.getUniversityNameTag())
.universityMajorTag(highSchoolStudentQuestion.getUniversityMajorTag().getValue())
.universityGradeTag(highSchoolStudentQuestion.getUniversityGradeTag().getValue())
.build();
}
}
Loading