Skip to content

Commit d1f81d4

Browse files
authored
Merge pull request #80 from GD-YD/hotfix/university-name-tag-validation
2 parents 698d0da + 7b190e7 commit d1f81d4

File tree

4 files changed

+42
-3
lines changed

4 files changed

+42
-3
lines changed

gd-yd-api/src/main/java/com/gdyd/gdydapi/request/mentoring/CreateHighSchoolStudentQuestionRequest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ public static HighSchoolStudentQuestion toHighSchoolStudentQuestion(
3636
CreateHighSchoolStudentQuestionRequest request,
3737
HighSchoolStudent highSchoolStudent
3838
) {
39+
String universityNameTag = request.universityNameTag() == null || request.universityNameTag().isBlank()
40+
? "DEFAULT"
41+
: request.universityNameTag();
3942
UniversityMajorCategory universityMajorTag = request.universityMajorTag() == null
4043
? UniversityMajorCategory.DEFAULT
4144
: request.universityMajorTag();
@@ -47,7 +50,7 @@ public static HighSchoolStudentQuestion toHighSchoolStudentQuestion(
4750
.title(request.title())
4851
.question(request.question())
4952
.highSchoolStudent(highSchoolStudent)
50-
.universityNameTag(request.universityNameTag())
53+
.universityNameTag(universityNameTag)
5154
.universityGradeTag(universityGradeTag)
5255
.universityMajorTag(universityMajorTag)
5356
.build();

gd-yd-api/src/main/java/com/gdyd/gdydapi/response/mentoring/CreateHighSchoolStudentQuestionResponse.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,25 @@ public record CreateHighSchoolStudentQuestionResponse(
1414
String title,
1515

1616
@Schema(description = "고등학생 질문 내용", example = "12344로 해당 대학에 입학할 수 있을까요?")
17-
String question
17+
String question,
18+
19+
@Schema(description = "질문글에서 답변을 원하는 대학생의 학교명")
20+
String universityNameTag,
21+
22+
@Schema(description = "질문글에서 답변을 원하는 대학생의 학과")
23+
String universityMajorTag,
24+
25+
@Schema(description = "질문글에서 답변을 원하는 대학생의 학년")
26+
String universityGradeTag
1827
) {
1928
public static CreateHighSchoolStudentQuestionResponse from(HighSchoolStudentQuestion highSchoolStudentQuestion) {
2029
return CreateHighSchoolStudentQuestionResponse.builder()
2130
.highSchoolStudentQuestionId(highSchoolStudentQuestion.getId())
2231
.title(highSchoolStudentQuestion.getTitle())
2332
.question(highSchoolStudentQuestion.getQuestion())
33+
.universityNameTag(highSchoolStudentQuestion.getUniversityNameTag())
34+
.universityMajorTag(highSchoolStudentQuestion.getUniversityMajorTag().getValue())
35+
.universityGradeTag(highSchoolStudentQuestion.getUniversityGradeTag().getValue())
2436
.build();
2537
}
2638
}

gd-yd-api/src/main/java/com/gdyd/gdydapi/response/mentoring/DetailHighSchoolStudentQuestionResponse.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ public record DetailHighSchoolStudentQuestionResponse(
2323
@Schema(description = "고등학생 질문 내용", example = "이번에 모의고사 성적이 나왔는데, 이 성적으로 어떤 대학을 갈수 있을까요?")
2424
String question,
2525

26+
@Schema(description = "고등학생 질문에서 답변을 원하는 대학생의 학교명", example = "단국대학교")
27+
String universityNameTag,
28+
29+
@Schema(description = "고등학생 질문에서 답변을 원하는 대학생의 학과", example = "컴퓨터/SW")
30+
String universityMajorTag,
31+
32+
@Schema(description = "고등학생 질문에서 답변을 원하는 대학생의 학년", example = "1학년")
33+
String universityGradeTag,
34+
2635
@Schema(description = "고등학생 질문에 대한 좋아요 수", example = "3")
2736
Long likeCount,
2837

@@ -51,6 +60,9 @@ public static DetailHighSchoolStudentQuestionResponse of(
5160
.highSchoolStudentNickname(highSchoolStudentQuestion.getHighSchoolStudent().getNickname())
5261
.title(highSchoolStudentQuestion.getTitle())
5362
.question(highSchoolStudentQuestion.getQuestion())
63+
.universityNameTag(highSchoolStudentQuestion.getUniversityNameTag())
64+
.universityMajorTag(highSchoolStudentQuestion.getUniversityMajorTag().getValue())
65+
.universityGradeTag(highSchoolStudentQuestion.getUniversityGradeTag().getValue())
5466
.likeCount(highSchoolStudentQuestion.getLikeCount())
5567
.awnserCount(highSchoolStudentQuestion.getAnswerCount())
5668
.highSchoolStudentQuestionMediaUrls(highSchoolStudentQuestionMediaUrls)

gd-yd-api/src/main/java/com/gdyd/gdydapi/response/mentoring/RecommendationHighSchoolStudentQuestionResponse.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,25 @@ public record RecommendationHighSchoolStudentQuestionResponse(
1414
String title,
1515

1616
@Schema(description = "매칭된 고등학생 질문글 내용", example = "현재 수능 23225 입니다.")
17-
String question
17+
String question,
18+
19+
@Schema(description = "매칭된 고등학생 질문글에서 답변을 원하는 대학생의 학교명", example = "단국대학교")
20+
String universityNameTag,
21+
22+
@Schema(description = "매칭된 고등학생 질문글에서 답변을 원하는 대학생의 학과", example = "컴퓨터/SW")
23+
String universityMajorTag,
24+
25+
@Schema(description = "매칭된 고등학생 질문글에서 답변을 원하는 대학생의 학년", example = "1학년")
26+
String universityGradeTag
1827
) {
1928
public static RecommendationHighSchoolStudentQuestionResponse from(HighSchoolStudentQuestion highSchoolStudentQuestion) {
2029
return RecommendationHighSchoolStudentQuestionResponse.builder()
2130
.id(highSchoolStudentQuestion.getId())
2231
.title(highSchoolStudentQuestion.getTitle())
2332
.question(highSchoolStudentQuestion.getQuestion())
33+
.universityNameTag(highSchoolStudentQuestion.getUniversityNameTag())
34+
.universityMajorTag(highSchoolStudentQuestion.getUniversityMajorTag().getValue())
35+
.universityGradeTag(highSchoolStudentQuestion.getUniversityGradeTag().getValue())
2436
.build();
2537
}
2638
}

0 commit comments

Comments
 (0)