-
Notifications
You must be signed in to change notification settings - Fork 8
feat: 유저의 멘토 지원서 신청 이력 조회 기능 추가 #603
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
sukangpunch
merged 7 commits into
solid-connection:develop
from
sukangpunch:feat/600-admin-mentor-application-history
Jan 11, 2026
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
0994bb9
feat: 유저의 멘토 지원 이력 조회 기능 추가
sukangpunch 8895ee1
refactor: 매개변수 타입 통일
sukangpunch 9e43bc3
test: 멘토 지원서 이력 조회 테스트 추가
sukangpunch c9ff45f
refactor: 리뷰 사항 적용
sukangpunch 1d44b1e
refactor: 서브모듈 해시값 되돌리기
sukangpunch 814e4da
refactor: applicationOrder 자료형을 long 으로 수정
sukangpunch f22a424
fix: applicationOrder 를 int 자료형으로 처리하도록 복구
sukangpunch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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/example/solidconnection/admin/dto/MentorApplicationHistoryResponse.java
This file contains hidden or 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.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 | ||
| ) { | ||
|
|
||
| } |
This file contains hidden or 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,17 +1,23 @@ | ||
| 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; | ||
| import com.example.solidconnection.common.exception.CustomException; | ||
| 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<MentorApplicationSearchResponse> searchMentorApplications( | ||
|
|
@@ -43,7 +50,7 @@ public void approveMentorApplication(Long mentorApplicationId) { | |
|
|
||
| @Transactional | ||
| public void rejectMentorApplication( | ||
| long mentorApplicationId, | ||
| Long mentorApplicationId, | ||
| MentorApplicationRejectRequest request | ||
| ) { | ||
| MentorApplication mentorApplication = mentorApplicationRepository.findById(mentorApplicationId) | ||
|
|
@@ -79,4 +86,25 @@ public void assignUniversity( | |
|
|
||
| mentorApplication.assignUniversity(university.getId()); | ||
| } | ||
|
|
||
| @Transactional(readOnly = true) | ||
| public List<MentorApplicationHistoryResponse> findMentorApplicationHistory(Long siteUserId) { | ||
| SiteUser siteUser = siteUserRepository.findById(siteUserId) | ||
| .orElseThrow(() -> new CustomException(USER_NOT_FOUND)); | ||
|
|
||
| long totalCount = mentorApplicationRepository.countBySiteUserId(siteUser.getId()); | ||
| List<MentorApplication> 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(); | ||
| } | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 여기 pr과 관련없지만 보여가지고 ㅎㅎ.. 개행 하나만 지워주실 수 있나요
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 혹시 95~97 라인 개행 말씀하시는거 맞나요? |
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.