[feat] 어드민 검수 요청 페이지 개선#686
Conversation
Walkthrough
Changes담당자 기준 검수 요청 필터링 및 UI 개선
추정 코드 리뷰 노력🎯 3 (Moderate) | ⏱️ ~20 minutes 제안 레이블
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
backend/turip-admin/src/test/java/turip/controller/AdminPendingContentApiTest.java (1)
560-566: ⚡ Quick win
my-list성공 케이스에서validatorNickname응답 검증을 추가해 주세요.이번 변경의 핵심 계약(담당자 가시성)인데 현재 성공 테스트가 해당 필드를 확인하지 않아 회귀를 놓칠 수 있습니다.
검증 라인 추가 예시
.body("[0].videoTitle", is("테스트 비디오")) .body("[0].channelName", is("테스트 채널")) .body("[0].collectorNickname", notNullValue()) + .body("[0].validatorNickname", notNullValue()) .body("[0].createdAt", notNullValue());🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@backend/turip-admin/src/test/java/turip/controller/AdminPendingContentApiTest.java` around lines 560 - 566, The test assertions for the my-list success case are missing validation for the validatorNickname field, which is a critical contract of this change. Add a body assertion for [0].validatorNickname using notNullValue() matcher in the AdminPendingContentApiTest test method, following the same pattern as the existing field validations like collectorNickname and createdAt to ensure regression testing covers this important field.backend/turip-admin/src/test/java/turip/service/AdminContentPendingServiceTest.java (1)
381-425: ⚡ Quick win
countMyPending()서비스 단위 테스트도 함께 추가해 주세요.신규 서비스 메서드가 추가됐는데, 현재 이 파일에는
findByValidatorAccount()만 검증되어 있어status + validator인자 전달 회귀를 바로 잡기 어렵습니다. 간단한 단위 테스트 1개를 추가하면 안정성이 올라갑니다.테스트 추가 예시
+ `@DisplayName`("countMyPending() 테스트") + `@Nested` + class CountMyPending { + + `@DisplayName`("validator 기준 PENDING 개수를 조회할 수 있다") + `@Test` + void countMyPending1() { + // given + given(contentPendingRepository.countByStatusAndValidatorAccount( + ContentPendingStatus.PENDING, validatorAccount + )).willReturn(2L); + + // when + long count = adminContentPendingService.countMyPending(validatorAccount); + + // then + assertAll( + () -> assertThat(count).isEqualTo(2L), + () -> verify(contentPendingRepository).countByStatusAndValidatorAccount( + ContentPendingStatus.PENDING, validatorAccount) + ); + } + }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@backend/turip-admin/src/test/java/turip/service/AdminContentPendingServiceTest.java` around lines 381 - 425, Add a new unit test for the countMyPending() service method in this test file. Create a new nested test class similar to the existing FindByValidatorAccount class, and add a test method that verifies countMyPending() correctly returns the count of pending contents for a given validator account. Mock the repository method call to return an expected count, then assert that the service method returns the correct value and that the repository was called with the proper ContentPendingStatus.PENDING and validator account arguments.backend/turip-app/src/main/java/turip/content/repository/ContentPendingRepository.java (1)
23-30: 상태+담당자 조건 조회에 맞춘 복합 인덱스를 운영 환경에서 검토해 주세요.
/my-list,/my-count는status + validator_account조건을 반복 사용하므로, 데이터가 커지면 count/list 모두 스캔 비용이 커질 수 있습니다.content_pending(status, validator_account_id, id)계열 인덱스를 두면 응답 지연을 줄이기 좋습니다.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@backend/turip-app/src/main/java/turip/content/repository/ContentPendingRepository.java` around lines 23 - 30, The methods countByStatusAndValidatorAccount and findAllByStatusAndValidatorAccountOrderByIdDesc perform repeated queries using the status and validator_account combination as filter conditions. Create a composite database index on the content_pending table with columns (status, validator_account_id, id) to optimize query performance and reduce scan costs. This index should be added to the database migration or schema definition for the production environment to improve response times for the /my-list and /my-count endpoints.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@backend/turip-admin/src/test/java/turip/controller/AdminPendingContentApiTest.java`:
- Around line 560-566: The test assertions for the my-list success case are
missing validation for the validatorNickname field, which is a critical contract
of this change. Add a body assertion for [0].validatorNickname using
notNullValue() matcher in the AdminPendingContentApiTest test method, following
the same pattern as the existing field validations like collectorNickname and
createdAt to ensure regression testing covers this important field.
In
`@backend/turip-admin/src/test/java/turip/service/AdminContentPendingServiceTest.java`:
- Around line 381-425: Add a new unit test for the countMyPending() service
method in this test file. Create a new nested test class similar to the existing
FindByValidatorAccount class, and add a test method that verifies
countMyPending() correctly returns the count of pending contents for a given
validator account. Mock the repository method call to return an expected count,
then assert that the service method returns the correct value and that the
repository was called with the proper ContentPendingStatus.PENDING and validator
account arguments.
In
`@backend/turip-app/src/main/java/turip/content/repository/ContentPendingRepository.java`:
- Around line 23-30: The methods countByStatusAndValidatorAccount and
findAllByStatusAndValidatorAccountOrderByIdDesc perform repeated queries using
the status and validator_account combination as filter conditions. Create a
composite database index on the content_pending table with columns (status,
validator_account_id, id) to optimize query performance and reduce scan costs.
This index should be added to the database migration or schema definition for
the production environment to improve response times for the /my-list and
/my-count endpoints.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 782ac865-d0a0-4847-b0a4-032352467e88
📒 Files selected for processing (8)
backend/turip-admin/src/main/java/turip/controller/AdminPendingContentController.javabackend/turip-admin/src/main/java/turip/controller/dto/response/PendingListResponse.javabackend/turip-admin/src/main/java/turip/service/AdminContentPendingService.javabackend/turip-admin/src/main/resources/templates/admin/home.htmlbackend/turip-admin/src/main/resources/templates/admin/pending-list.htmlbackend/turip-admin/src/test/java/turip/controller/AdminPendingContentApiTest.javabackend/turip-admin/src/test/java/turip/service/AdminContentPendingServiceTest.javabackend/turip-app/src/main/java/turip/content/repository/ContentPendingRepository.java
Issues
✔️ Check-list
🗒️ Work Description
/api/v1/admin/content-pendings/my-list: 나에게 온 검수 요청 확인 API/api/v1/admin/content-pendings/my-count: 나에게 온 검수 요청 수 확인 API📷 Screenshot
📚 Reference
Summary by CodeRabbit
새로운 기능