[refactor] 공지사항 API RESTful 설계 복구 및 이슈 범위 외 코드 제거#178
Conversation
- Update test to expect active-only workplaces when isActive is null - Change mock and verify to use findByEmployerIdAndIsActive instead of findByEmployerId - Fixes code-test mismatch from feat/159 review
…ve unrelated isActive filter
- Restore POST /api/workplaces/{workplaceId}/notices endpoint (RESTful design)
- Restore createNotice(Long workplaceId, User, Request) method signature
- Remove workplaceId field from NoticeDto.CreateRequest
- Revert WorkplaceService.getWorkplacesByUserId to single-param signature
- Remove isActive query param from WorkplaceController (unrelated to issue #159)
- Remove WorkplaceControllerTest added for isActive feature
- Update NoticeServiceTest and WorkplaceServiceTest accordingly
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 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. Review rate limit: 0/1 reviews remaining, refill in 20 minutes and 36 seconds.Comment |
🔖 관련 GitHub Issue
📝 변경 사항
주요 변경 내용
POST /api/notices→POST /api/workplaces/{workplaceId}/notices)isActive필터 기능 제거WorkplaceControllerTest.java(isActive 테스트 전용 파일) 삭제상세 설명
기존 브랜치에서 두 가지 문제가 발견되어 수정하였습니다.
1. API URL 설계 퇴행
공지사항 작성 엔드포인트가
POST /api/workplaces/{workplaceId}/notices(RESTful)에서POST /api/notices(workplaceId를 body로 이동)로 변경되어 있었습니다. 이는 리소스 계층구조를 손실하는 설계 퇴행이므로 원래 URL 구조로 복구했습니다.@PreAuthorize의 SpEL 표현식도#request.workplaceId→#workplaceId(경로 변수)로 복구하여 권한 검증이 명확하게 동작하도록 수정했습니다.2. 이슈 범위 외 코드 혼재
WorkplaceService.getWorkplacesByUserId에Boolean isActive파라미터를 추가하는 변경이 포함되어 있었으나, 이는 이슈 #159(근무지 지정 기능)와 직접적인 연관이 없는 별개 기능입니다. 별도 이슈로 분리하여 처리해야 하므로 제거했습니다.이슈 #159 "게시판 글 작성 시 근무지 지정 기능"은 기존
POST /api/workplaces/{workplaceId}/notices설계로 이미 지원됩니다.📸 스크린샷 (선택사항)
스크린샷 보기
Before
변경 전:
POST /api/notices(body에 workplaceId 포함)After
변경 후:
POST /api/workplaces/{workplaceId}/notices(경로 변수로 workplaceId 지정)✅ 체크리스트
🔗 관련 PR