-
Notifications
You must be signed in to change notification settings - Fork 1
Refactor/mosu 374 관리자 대시보드 신청 수 수정, 수험표 및 관리자 신청 조회 부분 user -> profile 로 변경 #375
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,12 @@ | ||
| package life.mosu.mosuserver.application.admin; | ||
|
|
||
| import java.time.LocalDate; | ||
| import life.mosu.mosuserver.domain.examapplication.repository.ExamApplicationJpaRepository; | ||
| import life.mosu.mosuserver.domain.refund.repository.RefundFailureLogJpaRepository; | ||
| import life.mosu.mosuserver.domain.user.entity.UserRole; | ||
| import life.mosu.mosuserver.domain.user.repository.UserJpaRepository; | ||
| import life.mosu.mosuserver.domain.virtualaccount.DepositStatus; | ||
| import life.mosu.mosuserver.domain.virtualaccount.VirtualAccountLogJpaRepository; | ||
| import life.mosu.mosuserver.presentation.admin.dto.DashBoardResponse; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.stereotype.Service; | ||
|
|
@@ -13,13 +16,21 @@ | |
| public class AdminDashboardService { | ||
|
|
||
| private final ExamApplicationJpaRepository examApplicationJpaRepository; | ||
| private final VirtualAccountLogJpaRepository virtualAccountLogJpaRepository; | ||
| private final UserJpaRepository userJpaRepository; | ||
| private final RefundFailureLogJpaRepository refundFailureLogJpaRepository; | ||
|
|
||
| // 대시보드 정보 조회 | ||
| public DashBoardResponse getAll() { | ||
|
|
||
| Long applicationCounts = examApplicationJpaRepository.countAll(); | ||
| LocalDate startDate = LocalDate.of(2025, 8, 20); | ||
| Long paymentCounts = examApplicationJpaRepository.countAllSince(startDate); | ||
|
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. 💡 Verification agent 🧩 Analysis chainVerify the repository methods exist and handle edge cases. Please ensure that:
Also applies to: 29-30 🏁 Script executed: #!/bin/bash
# Description: Verify the repository methods exist and check their implementations
# Search for countAllSince method in ExamApplicationJpaRepository
echo "=== Checking ExamApplicationJpaRepository.countAllSince method ==="
rg -n "countAllSince" --type=java
# Search for countByDepositStatus method in VirtualAccountLogJpaRepository
echo -e "\n=== Checking VirtualAccountLogJpaRepository.countByDepositStatus method ==="
rg -n "countByDepositStatus" --type=java
# Check DepositStatus enum values
echo -e "\n=== Checking DepositStatus enum ==="
rg -n "enum DepositStatus|DONE" --type=java -A 5 -B 2Length of output: 36166 Add null check for Objects.requireNonNull(startDate, "startDate must not be null");before calling examApplicationJpaRepository.countAllSince(startDate);Methods exist as expected. 🤖 Prompt for AI Agents |
||
|
|
||
| Long virtualAccountCounts = virtualAccountLogJpaRepository.countByDepositStatus( | ||
| DepositStatus.DONE); | ||
|
|
||
| Long applicationCounts = paymentCounts + virtualAccountCounts; | ||
|
|
||
| Long refundAbortedCounts = refundFailureLogJpaRepository.count(); | ||
| Long userCounts = userJpaRepository.countByUserRoleNot(UserRole.ROLE_ADMIN); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
하드코딩된 날짜
LocalDate.of(2025, 8, 20)가 사용되었습니다. 이러한 '매직 값'은 코드의 의도를 파악하기 어렵게 만들고, 향후 날짜 변경이 필요할 때 여러 곳을 수정해야 하는 등 유지보수를 어렵게 할 수 있습니다. 이 값을 의도를 명확히 나타내는 이름의 상수로 추출하는 것이 좋습니다. 예를 들어, 클래스 상단에private static final LocalDate APPLICATION_COUNT_START_DATE = LocalDate.of(2025, 8, 20);와 같이 상수를 선언하고 이를 참조하도록 변경하는 것을 권장합니다.