Skip to content

[refactor] 공지사항 API RESTful 설계 복구 및 이슈 범위 외 코드 제거#178

Merged
geunyong16 merged 5 commits into
mainfrom
feat/159-add-workplace-status-filter
May 3, 2026
Merged

[refactor] 공지사항 API RESTful 설계 복구 및 이슈 범위 외 코드 제거#178
geunyong16 merged 5 commits into
mainfrom
feat/159-add-workplace-status-filter

Conversation

@geunyong16
Copy link
Copy Markdown
Collaborator

@geunyong16 geunyong16 commented May 3, 2026

🔖 관련 GitHub Issue

📝 변경 사항

주요 변경 내용

  • 공지사항 작성 API URL을 RESTful 설계로 복구 (POST /api/noticesPOST /api/workplaces/{workplaceId}/notices)
  • 이슈 #159와 무관하게 추가된 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.getWorkplacesByUserIdBoolean isActive 파라미터를 추가하는 변경이 포함되어 있었으나, 이는 이슈 #159(근무지 지정 기능)와 직접적인 연관이 없는 별개 기능입니다. 별도 이슈로 분리하여 처리해야 하므로 제거했습니다.

이슈 #159 "게시판 글 작성 시 근무지 지정 기능"은 기존 POST /api/workplaces/{workplaceId}/notices 설계로 이미 지원됩니다.

📸 스크린샷 (선택사항)

스크린샷 보기

Before

변경 전: POST /api/notices (body에 workplaceId 포함)

After

변경 후: POST /api/workplaces/{workplaceId}/notices (경로 변수로 workplaceId 지정)

✅ 체크리스트

  • PR 제목이 형식에 맞는가? (유형: 작업 요약)
  • 코드가 정상적으로 빌드되는가?
  • 새로운 기능에 대한 테스트 코드를 작성했는가?
  • 모든 테스트가 통과하는가?
  • 코드 스타일 가이드를 따랐는가?
  • 관련 문서를 업데이트했는가?

🔗 관련 PR

  • Related to #

- 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
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 3, 2026

Warning

Rate limit exceeded

@geunyong16 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 20 minutes and 36 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 71a6d976-eb57-4966-9034-f3aec13280f1

📥 Commits

Reviewing files that changed from the base of the PR and between c9f3611 and 9d98973.

📒 Files selected for processing (2)
  • src/main/java/com/example/paycheck/domain/notice/service/NoticeService.java
  • src/test/java/com/example/paycheck/domain/workplace/service/WorkplaceServiceTest.java
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/159-add-workplace-status-filter

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.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 20 minutes and 36 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@geunyong16 geunyong16 merged commit 21ab534 into main May 3, 2026
2 checks passed
@geunyong16 geunyong16 deleted the feat/159-add-workplace-status-filter branch May 3, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] 게시판 글 작성 시 근무지 선택 필수 파라미터 추가

1 participant