From 0994bb9c4d00f5f7a8f121234b7a647e5c685bf4 Mon Sep 17 00:00:00 2001 From: sukangpunch Date: Tue, 30 Dec 2025 18:01:24 +0900 Subject: [PATCH 1/7] =?UTF-8?q?feat:=20=EC=9C=A0=EC=A0=80=EC=9D=98=20?= =?UTF-8?q?=EB=A9=98=ED=86=A0=20=EC=A7=80=EC=9B=90=20=EC=9D=B4=EB=A0=A5=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AdminMentorApplicationController.java | 10 +++++++ .../dto/MentorApplicationHistoryResponse.java | 14 +++++++++ .../AdminMentorApplicationService.java | 29 +++++++++++++++++++ .../MentorApplicationRepository.java | 4 +++ src/main/resources/secret | 2 +- 5 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/example/solidconnection/admin/dto/MentorApplicationHistoryResponse.java diff --git a/src/main/java/com/example/solidconnection/admin/controller/AdminMentorApplicationController.java b/src/main/java/com/example/solidconnection/admin/controller/AdminMentorApplicationController.java index b8fe6974..5895a81d 100644 --- a/src/main/java/com/example/solidconnection/admin/controller/AdminMentorApplicationController.java +++ b/src/main/java/com/example/solidconnection/admin/controller/AdminMentorApplicationController.java @@ -2,12 +2,14 @@ import com.example.solidconnection.admin.dto.MentorApplicationAssignUniversityRequest; import com.example.solidconnection.admin.dto.MentorApplicationCountResponse; +import com.example.solidconnection.admin.dto.MentorApplicationHistoryResponse; import com.example.solidconnection.admin.dto.MentorApplicationRejectRequest; import com.example.solidconnection.admin.dto.MentorApplicationSearchCondition; import com.example.solidconnection.admin.dto.MentorApplicationSearchResponse; import com.example.solidconnection.admin.service.AdminMentorApplicationService; import com.example.solidconnection.common.response.PageResponse; import jakarta.validation.Valid; +import java.util.List; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.data.domain.Page; @@ -73,4 +75,12 @@ public ResponseEntity assignUniversity( adminMentorApplicationService.assignUniversity(mentorApplicationId, universityId); return ResponseEntity.ok().build(); } + + @GetMapping("/{site-user-id}/mentor-application-history") + public ResponseEntity> getMentorApplicationHistory( + @PathVariable("site-user-id") Long siteUserId + ){ + List response = adminMentorApplicationService.findMentorApplicationHistory(siteUserId); + return ResponseEntity.ok(response); + } } diff --git a/src/main/java/com/example/solidconnection/admin/dto/MentorApplicationHistoryResponse.java b/src/main/java/com/example/solidconnection/admin/dto/MentorApplicationHistoryResponse.java new file mode 100644 index 00000000..46f7493d --- /dev/null +++ b/src/main/java/com/example/solidconnection/admin/dto/MentorApplicationHistoryResponse.java @@ -0,0 +1,14 @@ +package com.example.solidconnection.admin.dto; + +import com.example.solidconnection.mentor.domain.MentorApplicationStatus; +import java.time.ZonedDateTime; + +public record MentorApplicationHistoryResponse( + long id, + MentorApplicationStatus mentorApplicationStatus, + String rejectedReason, + ZonedDateTime createdAt, + int applicationOrder +) { + +} diff --git a/src/main/java/com/example/solidconnection/admin/service/AdminMentorApplicationService.java b/src/main/java/com/example/solidconnection/admin/service/AdminMentorApplicationService.java index d22d9af7..f41b30c6 100644 --- a/src/main/java/com/example/solidconnection/admin/service/AdminMentorApplicationService.java +++ b/src/main/java/com/example/solidconnection/admin/service/AdminMentorApplicationService.java @@ -1,8 +1,10 @@ package com.example.solidconnection.admin.service; import static com.example.solidconnection.common.exception.ErrorCode.MENTOR_APPLICATION_NOT_FOUND; +import static com.example.solidconnection.common.exception.ErrorCode.USER_NOT_FOUND; import com.example.solidconnection.admin.dto.MentorApplicationCountResponse; +import com.example.solidconnection.admin.dto.MentorApplicationHistoryResponse; import com.example.solidconnection.admin.dto.MentorApplicationRejectRequest; import com.example.solidconnection.admin.dto.MentorApplicationSearchCondition; import com.example.solidconnection.admin.dto.MentorApplicationSearchResponse; @@ -10,8 +12,12 @@ import com.example.solidconnection.mentor.domain.MentorApplication; import com.example.solidconnection.mentor.domain.MentorApplicationStatus; import com.example.solidconnection.mentor.repository.MentorApplicationRepository; +import com.example.solidconnection.siteuser.domain.SiteUser; +import com.example.solidconnection.siteuser.repository.SiteUserRepository; import com.example.solidconnection.university.domain.University; import com.example.solidconnection.university.repository.UniversityRepository; +import java.util.List; +import java.util.stream.IntStream; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; @@ -24,6 +30,7 @@ public class AdminMentorApplicationService { private final MentorApplicationRepository mentorApplicationRepository; private final UniversityRepository universityRepository; + private final SiteUserRepository siteUserRepository; @Transactional(readOnly = true) public Page searchMentorApplications( @@ -79,4 +86,26 @@ public void assignUniversity( mentorApplication.assignUniversity(university.getId()); } + + @Transactional(readOnly = true) + public List findMentorApplicationHistory(Long siteUserId) { + SiteUser siteUser = siteUserRepository.findById(siteUserId) + .orElseThrow(() -> new CustomException(USER_NOT_FOUND)); + + long totalCount = mentorApplicationRepository.countBySiteUserId(siteUserId); + + List mentorApplications = mentorApplicationRepository.findTop5BySiteUserIdOrderByCreatedAtDesc(siteUser.getId()); + + return IntStream.range(0, mentorApplications.size()) + .mapToObj(index -> { + MentorApplication app = mentorApplications.get(index); + return new MentorApplicationHistoryResponse( + app.getId(), + app.getMentorApplicationStatus(), + app.getRejectedReason(), + app.getCreatedAt(), + (int) totalCount - index + ); + }).toList(); + } } diff --git a/src/main/java/com/example/solidconnection/mentor/repository/MentorApplicationRepository.java b/src/main/java/com/example/solidconnection/mentor/repository/MentorApplicationRepository.java index 144b5461..61339819 100644 --- a/src/main/java/com/example/solidconnection/mentor/repository/MentorApplicationRepository.java +++ b/src/main/java/com/example/solidconnection/mentor/repository/MentorApplicationRepository.java @@ -14,4 +14,8 @@ public interface MentorApplicationRepository extends JpaRepository findBySiteUserIdAndMentorApplicationStatus(long siteUserId, MentorApplicationStatus mentorApplicationStatus); long countByMentorApplicationStatus(MentorApplicationStatus mentorApplicationStatus); + + List findTop5BySiteUserIdOrderByCreatedAtDesc(long siteUserId); + + long countBySiteUserId(long siteUserId); } diff --git a/src/main/resources/secret b/src/main/resources/secret index 29524e2d..8300cdec 160000 --- a/src/main/resources/secret +++ b/src/main/resources/secret @@ -1 +1 @@ -Subproject commit 29524e2d6dad2042400de0370a11893029aacff2 +Subproject commit 8300cdecaebfc28fd657064a00a44815a7bb2eee From 8895ee1cda5d515903c1e82318ada516af1f60a0 Mon Sep 17 00:00:00 2001 From: sukangpunch Date: Tue, 30 Dec 2025 18:03:25 +0900 Subject: [PATCH 2/7] =?UTF-8?q?refactor:=20=EB=A7=A4=EA=B0=9C=EB=B3=80?= =?UTF-8?q?=EC=88=98=20=ED=83=80=EC=9E=85=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: long 타입을 Long 으로 수정 --- .../admin/service/AdminMentorApplicationService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/example/solidconnection/admin/service/AdminMentorApplicationService.java b/src/main/java/com/example/solidconnection/admin/service/AdminMentorApplicationService.java index f41b30c6..dfa71b56 100644 --- a/src/main/java/com/example/solidconnection/admin/service/AdminMentorApplicationService.java +++ b/src/main/java/com/example/solidconnection/admin/service/AdminMentorApplicationService.java @@ -50,7 +50,7 @@ public void approveMentorApplication(Long mentorApplicationId) { @Transactional public void rejectMentorApplication( - long mentorApplicationId, + Long mentorApplicationId, MentorApplicationRejectRequest request ) { MentorApplication mentorApplication = mentorApplicationRepository.findById(mentorApplicationId) From 9e43bc3f4971db75d0866020b5ab5a4a84b2c598 Mon Sep 17 00:00:00 2001 From: sukangpunch Date: Fri, 2 Jan 2026 20:03:31 +0900 Subject: [PATCH 3/7] =?UTF-8?q?test:=20=EB=A9=98=ED=86=A0=20=EC=A7=80?= =?UTF-8?q?=EC=9B=90=EC=84=9C=20=EC=9D=B4=EB=A0=A5=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test: MentorApplicationFixtureBuilder 에 rejectedReason 필드 및 빌더 메서드 추가 --- .../AdminMentorApplicationServiceTest.java | 104 ++++++++++++++++++ .../fixture/MentorApplicationFixture.java | 2 + .../MentorApplicationFixtureBuilder.java | 9 ++ 3 files changed, 115 insertions(+) diff --git a/src/test/java/com/example/solidconnection/admin/service/AdminMentorApplicationServiceTest.java b/src/test/java/com/example/solidconnection/admin/service/AdminMentorApplicationServiceTest.java index ae40cb5d..4a3c1ad9 100644 --- a/src/test/java/com/example/solidconnection/admin/service/AdminMentorApplicationServiceTest.java +++ b/src/test/java/com/example/solidconnection/admin/service/AdminMentorApplicationServiceTest.java @@ -5,11 +5,13 @@ import static com.example.solidconnection.common.exception.ErrorCode.MENTOR_APPLICATION_NOT_OTHER_STATUS; import static com.example.solidconnection.common.exception.ErrorCode.MENTOR_APPLICATION_UNIVERSITY_NOT_SELECTED; import static com.example.solidconnection.common.exception.ErrorCode.UNIVERSITY_NOT_FOUND; +import static com.example.solidconnection.common.exception.ErrorCode.USER_NOT_FOUND; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.AssertionsForClassTypes.assertThatCode; import static org.junit.jupiter.api.Assertions.assertAll; import com.example.solidconnection.admin.dto.MentorApplicationCountResponse; +import com.example.solidconnection.admin.dto.MentorApplicationHistoryResponse; import com.example.solidconnection.admin.dto.MentorApplicationRejectRequest; import com.example.solidconnection.admin.dto.MentorApplicationSearchCondition; import com.example.solidconnection.admin.dto.MentorApplicationSearchResponse; @@ -509,4 +511,106 @@ class 멘토_지원서에_대학_매핑 { .hasMessage(UNIVERSITY_NOT_FOUND.getMessage()); } } + + @Nested + class 멘토_지원서_이력_조회 { + + @Test + void 사용자의_멘토_지원서_이력을_최신_생성_내림차순으로_조회한다() { + // given + SiteUser user = siteUserFixture.사용자(); + University university = universityFixture.메이지_대학(); + MentorApplication app1 = mentorApplicationFixture.거절된_멘토신청(user.getId(), UniversitySelectType.CATALOG, university.getId()); + MentorApplication app2 = mentorApplicationFixture.거절된_멘토신청(user.getId(), UniversitySelectType.CATALOG, university.getId()); + MentorApplication app3 = mentorApplicationFixture.승인된_멘토신청(user.getId(), UniversitySelectType.CATALOG, university.getId()); + + // when + List response = adminMentorApplicationService.findMentorApplicationHistory(user.getId()); + + // then + assertAll( + () -> assertThat(response).hasSize(3), + () -> assertThat(response) + .extracting(MentorApplicationHistoryResponse::id) + .containsExactly(app3.getId(), app2.getId(), app1.getId()), + () -> assertThat(response) + .extracting(MentorApplicationHistoryResponse::applicationOrder) + .containsExactly(3,2,1) + ); + } + + @Test + void 지원서가_5개를_초과하면_최신_5개만_최신_생성_내림차순으로_조회한다() { + // given + SiteUser user = siteUserFixture.사용자(); + University university = universityFixture.메이지_대학(); + MentorApplication app1 = mentorApplicationFixture.거절된_멘토신청(user.getId(), UniversitySelectType.CATALOG, university.getId()); + MentorApplication app2 = mentorApplicationFixture.거절된_멘토신청(user.getId(), UniversitySelectType.CATALOG, university.getId()); + MentorApplication app3 = mentorApplicationFixture.거절된_멘토신청(user.getId(), UniversitySelectType.CATALOG, university.getId()); + MentorApplication app4 = mentorApplicationFixture.거절된_멘토신청(user.getId(), UniversitySelectType.CATALOG, university.getId()); + MentorApplication app5 = mentorApplicationFixture.거절된_멘토신청(user.getId(), UniversitySelectType.CATALOG, university.getId()); + MentorApplication app6 = mentorApplicationFixture.거절된_멘토신청(user.getId(), UniversitySelectType.CATALOG, university.getId()); + MentorApplication app7 = mentorApplicationFixture.승인된_멘토신청(user.getId(), UniversitySelectType.CATALOG, university.getId()); + + // when + List response = adminMentorApplicationService.findMentorApplicationHistory(user.getId()); + + // then + assertAll( + () -> assertThat(response).hasSize(5), + () -> assertThat(response) + .extracting(MentorApplicationHistoryResponse::id) + .containsExactly(app7.getId(), app6.getId(), app5.getId(), app4.getId(), app3.getId()), + () -> assertThat(response) + .extracting(MentorApplicationHistoryResponse::applicationOrder) + .containsExactly(7,6,5,4,3) + ); + } + + @Test + void 지원서_이력이_없으면_빈_목록을_반환한다() { + // given + SiteUser user = siteUserFixture.사용자(); + + // when + List response = adminMentorApplicationService.findMentorApplicationHistory(user.getId()); + + // then + assertThat(response).isEmpty(); + } + + @Test + void 응답에_지원서_상태와_거절_사유가_포함된다() { + // given + SiteUser user = siteUserFixture.사용자(); + University university = universityFixture.메이지_대학(); + mentorApplicationFixture.거절된_멘토신청(user.getId(), UniversitySelectType.CATALOG, university.getId()); + mentorApplicationFixture.승인된_멘토신청(user.getId(), UniversitySelectType.CATALOG, university.getId()); + + // when + List response = adminMentorApplicationService.findMentorApplicationHistory(user.getId()); + + // then + assertAll( + () -> assertThat(response).hasSize(2), + () -> assertThat(response.get(0).mentorApplicationStatus()).isEqualTo(MentorApplicationStatus.APPROVED), + () -> assertThat(response.get(0).rejectedReason()).isNull(), + () -> assertThat(response.get(0).applicationOrder()).isEqualTo(2), + () -> assertThat(response.get(1).mentorApplicationStatus()).isEqualTo(MentorApplicationStatus.REJECTED), + () -> assertThat(response.get(1).rejectedReason()).isNotNull(), + () -> assertThat(response.get(1).applicationOrder()).isEqualTo(1) + ); + } + + @Test + void 존재하지_않는_사용자_이력을_조회하면_예외_응답을_반환한다() { + // given + long nonExistentUserId = 99999L; + + // when & then + assertThatCode(() -> adminMentorApplicationService.findMentorApplicationHistory(nonExistentUserId)) + .isInstanceOf(CustomException.class) + .hasMessage(USER_NOT_FOUND.getMessage()); + } + } } diff --git a/src/test/java/com/example/solidconnection/mentor/fixture/MentorApplicationFixture.java b/src/test/java/com/example/solidconnection/mentor/fixture/MentorApplicationFixture.java index 0baf62e2..6a715375 100644 --- a/src/test/java/com/example/solidconnection/mentor/fixture/MentorApplicationFixture.java +++ b/src/test/java/com/example/solidconnection/mentor/fixture/MentorApplicationFixture.java @@ -18,6 +18,7 @@ public class MentorApplicationFixture { private static final String DEFAULT_COUNTRY_CODE = "US"; private static final String DEFAULT_PROOF_URL = "/mentor-proof.pdf"; private static final ExchangeStatus DEFAULT_EXCHANGE_STATUS = ExchangeStatus.AFTER_EXCHANGE; + private static final String REJECTED_REASON = "pdf 파일 안열림"; public MentorApplication 대기중_멘토신청( long siteUserId, @@ -64,6 +65,7 @@ public class MentorApplicationFixture { .universitySelectType(selectType) .mentorProofUrl(DEFAULT_PROOF_URL) .termId(termFixture.현재_학기("2025-1").getId()) + .rejectedReason(REJECTED_REASON) .exchangeStatus(DEFAULT_EXCHANGE_STATUS) .mentorApplicationStatus(MentorApplicationStatus.REJECTED) .create(); diff --git a/src/test/java/com/example/solidconnection/mentor/fixture/MentorApplicationFixtureBuilder.java b/src/test/java/com/example/solidconnection/mentor/fixture/MentorApplicationFixtureBuilder.java index fd2a74ff..93e5e24b 100644 --- a/src/test/java/com/example/solidconnection/mentor/fixture/MentorApplicationFixtureBuilder.java +++ b/src/test/java/com/example/solidconnection/mentor/fixture/MentorApplicationFixtureBuilder.java @@ -21,6 +21,7 @@ public class MentorApplicationFixtureBuilder { private UniversitySelectType universitySelectType = UniversitySelectType.OTHER; private String mentorProofUrl = "/mentor-proof.pdf"; private long termId; + private String rejectedReason = null; private ExchangeStatus exchangeStatus = ExchangeStatus.AFTER_EXCHANGE; private MentorApplicationStatus mentorApplicationStatus = MentorApplicationStatus.PENDING; @@ -58,6 +59,11 @@ public MentorApplicationFixtureBuilder termId(long termId) { return this; } + public MentorApplicationFixtureBuilder rejectedReason(String rejectedReason) { + this.rejectedReason = rejectedReason; + return this; + } + public MentorApplicationFixtureBuilder exchangeStatus(ExchangeStatus exchangeStatus) { this.exchangeStatus = exchangeStatus; return this; @@ -79,6 +85,9 @@ public MentorApplication create() { exchangeStatus ); ReflectionTestUtils.setField(mentorApplication, "mentorApplicationStatus", mentorApplicationStatus); + if(rejectedReason != null) { + ReflectionTestUtils.setField(mentorApplication, "rejectedReason", rejectedReason); + } return mentorApplicationRepository.save(mentorApplication); } } From c9ff45f646a91c4a19941f8d1da9fce53b0120bd Mon Sep 17 00:00:00 2001 From: sukangpunch Date: Sat, 3 Jan 2026 20:03:56 +0900 Subject: [PATCH 4/7] =?UTF-8?q?refactor:=20=EB=A6=AC=EB=B7=B0=20=EC=82=AC?= =?UTF-8?q?=ED=95=AD=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test: 멘토 지원서 이력 조회 에서 user와 university 재사용 * refactor: 긴 uri 를 짧게 수정 --- .../AdminMentorApplicationController.java | 2 +- .../AdminMentorApplicationServiceTest.java | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/example/solidconnection/admin/controller/AdminMentorApplicationController.java b/src/main/java/com/example/solidconnection/admin/controller/AdminMentorApplicationController.java index 5895a81d..c30a9620 100644 --- a/src/main/java/com/example/solidconnection/admin/controller/AdminMentorApplicationController.java +++ b/src/main/java/com/example/solidconnection/admin/controller/AdminMentorApplicationController.java @@ -76,7 +76,7 @@ public ResponseEntity assignUniversity( return ResponseEntity.ok().build(); } - @GetMapping("/{site-user-id}/mentor-application-history") + @GetMapping("/{site-user-id}/history") public ResponseEntity> getMentorApplicationHistory( @PathVariable("site-user-id") Long siteUserId ){ diff --git a/src/test/java/com/example/solidconnection/admin/service/AdminMentorApplicationServiceTest.java b/src/test/java/com/example/solidconnection/admin/service/AdminMentorApplicationServiceTest.java index 4a3c1ad9..0c133165 100644 --- a/src/test/java/com/example/solidconnection/admin/service/AdminMentorApplicationServiceTest.java +++ b/src/test/java/com/example/solidconnection/admin/service/AdminMentorApplicationServiceTest.java @@ -65,6 +65,9 @@ class AdminMentorApplicationServiceTest { private MentorApplication mentorApplication7; private MentorApplication mentorApplication8; + private SiteUser user; + private University university; + @BeforeEach void setUp() { SiteUser user1 = siteUserFixture.사용자(1, "test1"); @@ -86,6 +89,9 @@ void setUp() { mentorApplication6 = mentorApplicationFixture.거절된_멘토신청(user6.getId(), UniversitySelectType.CATALOG, university2.getId()); mentorApplication7 = mentorApplicationFixture.대기중_멘토신청(user7.getId(), UniversitySelectType.OTHER, null); mentorApplication8 = mentorApplicationFixture.거절된_멘토신청(user8.getId(), UniversitySelectType.OTHER, null); + + user = siteUserFixture.사용자(9, "test9"); + university = universityFixture.메이지_대학(); } @Nested @@ -518,8 +524,6 @@ class 멘토_지원서_이력_조회 { @Test void 사용자의_멘토_지원서_이력을_최신_생성_내림차순으로_조회한다() { // given - SiteUser user = siteUserFixture.사용자(); - University university = universityFixture.메이지_대학(); MentorApplication app1 = mentorApplicationFixture.거절된_멘토신청(user.getId(), UniversitySelectType.CATALOG, university.getId()); MentorApplication app2 = mentorApplicationFixture.거절된_멘토신청(user.getId(), UniversitySelectType.CATALOG, university.getId()); MentorApplication app3 = mentorApplicationFixture.승인된_멘토신청(user.getId(), UniversitySelectType.CATALOG, university.getId()); @@ -542,8 +546,6 @@ class 멘토_지원서_이력_조회 { @Test void 지원서가_5개를_초과하면_최신_5개만_최신_생성_내림차순으로_조회한다() { // given - SiteUser user = siteUserFixture.사용자(); - University university = universityFixture.메이지_대학(); MentorApplication app1 = mentorApplicationFixture.거절된_멘토신청(user.getId(), UniversitySelectType.CATALOG, university.getId()); MentorApplication app2 = mentorApplicationFixture.거절된_멘토신청(user.getId(), UniversitySelectType.CATALOG, university.getId()); MentorApplication app3 = mentorApplicationFixture.거절된_멘토신청(user.getId(), UniversitySelectType.CATALOG, university.getId()); @@ -570,10 +572,10 @@ class 멘토_지원서_이력_조회 { @Test void 지원서_이력이_없으면_빈_목록을_반환한다() { // given - SiteUser user = siteUserFixture.사용자(); + long withoutApplicationUserId = user.getId(); // when - List response = adminMentorApplicationService.findMentorApplicationHistory(user.getId()); + List response = adminMentorApplicationService.findMentorApplicationHistory(withoutApplicationUserId); // then assertThat(response).isEmpty(); @@ -582,8 +584,6 @@ class 멘토_지원서_이력_조회 { @Test void 응답에_지원서_상태와_거절_사유가_포함된다() { // given - SiteUser user = siteUserFixture.사용자(); - University university = universityFixture.메이지_대학(); mentorApplicationFixture.거절된_멘토신청(user.getId(), UniversitySelectType.CATALOG, university.getId()); mentorApplicationFixture.승인된_멘토신청(user.getId(), UniversitySelectType.CATALOG, university.getId()); From 1d44b1e48b8fd46243e0f8aee36472dc8ff5d7f3 Mon Sep 17 00:00:00 2001 From: sukangpunch Date: Sun, 4 Jan 2026 20:35:52 +0900 Subject: [PATCH 5/7] =?UTF-8?q?refactor:=20=EC=84=9C=EB=B8=8C=EB=AA=A8?= =?UTF-8?q?=EB=93=88=20=ED=95=B4=EC=8B=9C=EA=B0=92=20=EB=90=98=EB=8F=8C?= =?UTF-8?q?=EB=A6=AC=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: 개행 지우기 --- .../admin/service/AdminMentorApplicationService.java | 3 +-- src/main/resources/secret | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/example/solidconnection/admin/service/AdminMentorApplicationService.java b/src/main/java/com/example/solidconnection/admin/service/AdminMentorApplicationService.java index dfa71b56..86d8a039 100644 --- a/src/main/java/com/example/solidconnection/admin/service/AdminMentorApplicationService.java +++ b/src/main/java/com/example/solidconnection/admin/service/AdminMentorApplicationService.java @@ -92,8 +92,7 @@ public List findMentorApplicationHistory(Long SiteUser siteUser = siteUserRepository.findById(siteUserId) .orElseThrow(() -> new CustomException(USER_NOT_FOUND)); - long totalCount = mentorApplicationRepository.countBySiteUserId(siteUserId); - + long totalCount = mentorApplicationRepository.countBySiteUserId(siteUser.getId()); List mentorApplications = mentorApplicationRepository.findTop5BySiteUserIdOrderByCreatedAtDesc(siteUser.getId()); return IntStream.range(0, mentorApplications.size()) diff --git a/src/main/resources/secret b/src/main/resources/secret index 8300cdec..29524e2d 160000 --- a/src/main/resources/secret +++ b/src/main/resources/secret @@ -1 +1 @@ -Subproject commit 8300cdecaebfc28fd657064a00a44815a7bb2eee +Subproject commit 29524e2d6dad2042400de0370a11893029aacff2 From 814e4dad145ba3a10a8e082cddb75870a3f2fb8b Mon Sep 17 00:00:00 2001 From: sukangpunch Date: Wed, 7 Jan 2026 20:02:06 +0900 Subject: [PATCH 6/7] =?UTF-8?q?refactor:=20applicationOrder=20=EC=9E=90?= =?UTF-8?q?=EB=A3=8C=ED=98=95=EC=9D=84=20long=20=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/dto/MentorApplicationHistoryResponse.java | 2 +- .../admin/service/AdminMentorApplicationService.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/example/solidconnection/admin/dto/MentorApplicationHistoryResponse.java b/src/main/java/com/example/solidconnection/admin/dto/MentorApplicationHistoryResponse.java index 46f7493d..7d63e9a4 100644 --- a/src/main/java/com/example/solidconnection/admin/dto/MentorApplicationHistoryResponse.java +++ b/src/main/java/com/example/solidconnection/admin/dto/MentorApplicationHistoryResponse.java @@ -8,7 +8,7 @@ public record MentorApplicationHistoryResponse( MentorApplicationStatus mentorApplicationStatus, String rejectedReason, ZonedDateTime createdAt, - int applicationOrder + long applicationOrder ) { } diff --git a/src/main/java/com/example/solidconnection/admin/service/AdminMentorApplicationService.java b/src/main/java/com/example/solidconnection/admin/service/AdminMentorApplicationService.java index 86d8a039..efc2b06f 100644 --- a/src/main/java/com/example/solidconnection/admin/service/AdminMentorApplicationService.java +++ b/src/main/java/com/example/solidconnection/admin/service/AdminMentorApplicationService.java @@ -103,7 +103,7 @@ public List findMentorApplicationHistory(Long app.getMentorApplicationStatus(), app.getRejectedReason(), app.getCreatedAt(), - (int) totalCount - index + totalCount - index ); }).toList(); } From f22a4247359e1406128e2b8c29f20e6f188db1b2 Mon Sep 17 00:00:00 2001 From: sukangpunch Date: Thu, 8 Jan 2026 14:14:37 +0900 Subject: [PATCH 7/7] =?UTF-8?q?fix:=20applicationOrder=20=EB=A5=BC=20int?= =?UTF-8?q?=20=EC=9E=90=EB=A3=8C=ED=98=95=EC=9C=BC=EB=A1=9C=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=ED=95=98=EB=8F=84=EB=A1=9D=20=EB=B3=B5=EA=B5=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 순서를 나타내고, 해당 값이 21억을 넘길 수 없다 판단하여 더 적합한 int 자료형으로 복구 * test: long type 을 기대하던 테스트 에러 해결 --- .../admin/dto/MentorApplicationHistoryResponse.java | 2 +- .../admin/service/AdminMentorApplicationService.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/example/solidconnection/admin/dto/MentorApplicationHistoryResponse.java b/src/main/java/com/example/solidconnection/admin/dto/MentorApplicationHistoryResponse.java index 7d63e9a4..46f7493d 100644 --- a/src/main/java/com/example/solidconnection/admin/dto/MentorApplicationHistoryResponse.java +++ b/src/main/java/com/example/solidconnection/admin/dto/MentorApplicationHistoryResponse.java @@ -8,7 +8,7 @@ public record MentorApplicationHistoryResponse( MentorApplicationStatus mentorApplicationStatus, String rejectedReason, ZonedDateTime createdAt, - long applicationOrder + int applicationOrder ) { } diff --git a/src/main/java/com/example/solidconnection/admin/service/AdminMentorApplicationService.java b/src/main/java/com/example/solidconnection/admin/service/AdminMentorApplicationService.java index efc2b06f..86d8a039 100644 --- a/src/main/java/com/example/solidconnection/admin/service/AdminMentorApplicationService.java +++ b/src/main/java/com/example/solidconnection/admin/service/AdminMentorApplicationService.java @@ -103,7 +103,7 @@ public List findMentorApplicationHistory(Long app.getMentorApplicationStatus(), app.getRejectedReason(), app.getCreatedAt(), - totalCount - index + (int) totalCount - index ); }).toList(); }