diff --git a/src/main/java/com/example/solidconnection/mentor/domain/Mentor.java b/src/main/java/com/example/solidconnection/mentor/domain/Mentor.java index 1a5012015..d97f6a895 100644 --- a/src/main/java/com/example/solidconnection/mentor/domain/Mentor.java +++ b/src/main/java/com/example/solidconnection/mentor/domain/Mentor.java @@ -44,6 +44,9 @@ public class Mentor { @Column private long universityId; + @Column(length = 50, nullable = false) + private String term; + @BatchSize(size = 10) @OrderBy("sequence ASC") @OneToMany(mappedBy = "mentor", cascade = CascadeType.ALL, orphanRemoval = true) diff --git a/src/main/java/com/example/solidconnection/mentor/dto/MentorDetailResponse.java b/src/main/java/com/example/solidconnection/mentor/dto/MentorDetailResponse.java index 63255799e..3fc042aa7 100644 --- a/src/main/java/com/example/solidconnection/mentor/dto/MentorDetailResponse.java +++ b/src/main/java/com/example/solidconnection/mentor/dto/MentorDetailResponse.java @@ -1,7 +1,6 @@ package com.example.solidconnection.mentor.dto; import com.example.solidconnection.mentor.domain.Mentor; -import com.example.solidconnection.siteuser.domain.ExchangeStatus; import com.example.solidconnection.siteuser.domain.SiteUser; import java.util.List; @@ -9,9 +8,9 @@ public record MentorDetailResponse( long id, String nickname, String profileImageUrl, - ExchangeStatus exchangeStatus, String country, String universityName, + String term, int menteeCount, boolean hasBadge, String introduction, @@ -25,9 +24,9 @@ public static MentorDetailResponse of(Mentor mentor, SiteUser mentorUser, boolea mentor.getId(), mentorUser.getNickname(), mentorUser.getProfileImageUrl(), - mentorUser.getExchangeStatus(), "국가", // todo: 교환학생 기록이 인증되면 추가 "대학 이름", // todo: 교환학생 기록이 인증되면 추가 + mentor.getTerm(), mentor.getMenteeCount(), mentor.isHasBadge(), mentor.getIntroduction(), diff --git a/src/main/java/com/example/solidconnection/mentor/dto/MentorMyPageResponse.java b/src/main/java/com/example/solidconnection/mentor/dto/MentorMyPageResponse.java index 46012f068..95bb26506 100644 --- a/src/main/java/com/example/solidconnection/mentor/dto/MentorMyPageResponse.java +++ b/src/main/java/com/example/solidconnection/mentor/dto/MentorMyPageResponse.java @@ -1,7 +1,6 @@ package com.example.solidconnection.mentor.dto; import com.example.solidconnection.mentor.domain.Mentor; -import com.example.solidconnection.siteuser.domain.ExchangeStatus; import com.example.solidconnection.siteuser.domain.SiteUser; import java.util.List; @@ -9,9 +8,9 @@ public record MentorMyPageResponse( long id, String profileImageUrl, String nickname, - ExchangeStatus exchangeStatus, String country, String universityName, + String term, int menteeCount, boolean hasBadge, String introduction, @@ -23,9 +22,9 @@ public static MentorMyPageResponse of(Mentor mentor, SiteUser siteUser) { mentor.getId(), siteUser.getProfileImageUrl(), siteUser.getNickname(), - siteUser.getExchangeStatus(), "국가", // todo: 교환학생 기록이 인증되면 추가 "대학 이름", + mentor.getTerm(), mentor.getMenteeCount(), mentor.isHasBadge(), mentor.getIntroduction(), diff --git a/src/main/java/com/example/solidconnection/mentor/dto/MentorPreviewResponse.java b/src/main/java/com/example/solidconnection/mentor/dto/MentorPreviewResponse.java index 70695b462..dd590c179 100644 --- a/src/main/java/com/example/solidconnection/mentor/dto/MentorPreviewResponse.java +++ b/src/main/java/com/example/solidconnection/mentor/dto/MentorPreviewResponse.java @@ -1,7 +1,6 @@ package com.example.solidconnection.mentor.dto; import com.example.solidconnection.mentor.domain.Mentor; -import com.example.solidconnection.siteuser.domain.ExchangeStatus; import com.example.solidconnection.siteuser.domain.SiteUser; import java.util.List; @@ -9,9 +8,9 @@ public record MentorPreviewResponse( long id, String nickname, String profileImageUrl, - ExchangeStatus exchangeStatus, String country, String universityName, + String term, int menteeCount, boolean hasBadge, String introduction, @@ -24,9 +23,9 @@ public static MentorPreviewResponse of(Mentor mentor, SiteUser mentorUser, boole mentor.getId(), mentorUser.getNickname(), mentorUser.getProfileImageUrl(), - mentorUser.getExchangeStatus(), "국가", // todo: 교환학생 기록이 인증되면 추가 "대학 이름", // todo: 교환학생 기록이 인증되면 추가 + mentor.getTerm(), mentor.getMenteeCount(), mentor.isHasBadge(), mentor.getIntroduction(), diff --git a/src/main/java/com/example/solidconnection/mentor/dto/MentorPreviewsResponse.java b/src/main/java/com/example/solidconnection/mentor/dto/MentorPreviewsResponse.java deleted file mode 100644 index d322e22f9..000000000 --- a/src/main/java/com/example/solidconnection/mentor/dto/MentorPreviewsResponse.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.example.solidconnection.mentor.dto; - -import java.util.List; - -public record MentorPreviewsResponse( - List content, - int nextPageNumber -) { - -} diff --git a/src/main/resources/db/migration/V26__add_term_column_to_mentor.sql b/src/main/resources/db/migration/V26__add_term_column_to_mentor.sql new file mode 100644 index 000000000..dbf061090 --- /dev/null +++ b/src/main/resources/db/migration/V26__add_term_column_to_mentor.sql @@ -0,0 +1,2 @@ +ALTER TABLE mentor + ADD COLUMN term varchar(50) NOT NULL; diff --git a/src/test/java/com/example/solidconnection/mentor/fixture/MentorFixtureBuilder.java b/src/test/java/com/example/solidconnection/mentor/fixture/MentorFixtureBuilder.java index d499ecc2a..7eaaefa94 100644 --- a/src/test/java/com/example/solidconnection/mentor/fixture/MentorFixtureBuilder.java +++ b/src/test/java/com/example/solidconnection/mentor/fixture/MentorFixtureBuilder.java @@ -17,6 +17,7 @@ public class MentorFixtureBuilder { private String passTip; private long siteUserId; private long universityId; + private String term = "2025-1"; public MentorFixtureBuilder mentor() { return new MentorFixtureBuilder(mentorRepository); @@ -52,6 +53,11 @@ public MentorFixtureBuilder universityId(Long universityId) { return this; } + public MentorFixtureBuilder term(String term) { + this.term = term; + return this; + } + public Mentor create() { Mentor mentor = new Mentor( null, @@ -61,6 +67,7 @@ public Mentor create() { passTip, siteUserId, universityId, + term, null ); return mentorRepository.save(mentor);