Repository navigation
Conversation
학생 앱 조회는 NoticeService에 남기고, 운영진의 목록·상세·작성·수정·삭제·고정을 AdminNoticeService로 옮긴다.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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 |
github-actions
Bot
requested review from
leegain1,
sangrae2325,
tnals0924 and
xeoxxn
October 18, 2026 17:11
jjunh33
added this pull request to stack #147
October 18, 2026 17:32
tnals0924
reviewed
Oct 20, 2026
| */ | ||
| PageResult<Notice> search(String keyword, PageOffset pageOffset); | ||
|
|
||
| Notice getNotice(Long id); |
Member
There was a problem hiding this comment.
getNotice()가 NoticeService에서 사라지고 AdminNoticeService에만 있게 되었는데 일반 NoticeService에서는 이게 필요없나요?
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
#️⃣연관된 이슈
main으로 바꾸고main을 병합합니다🎯 해결하려는 문제가 무엇인가요?
NoticeService에 학생 앱의 조회(getNotices,getNotice)와 운영진의 쓰기·검색(create,update,delete,changePinned,search)이 한 인터페이스에 섞여 있습니다. 운영진 전용 기능을AdminNoticeService로 분리해 학생 앱이 보는 서비스에서 운영진 기능이 보이지 않게 합니다.❓ 왜 해결해야 하나요?
관리자 API가 늘어나는 중입니다. 지금 규칙(
{Domain}Service하나)이면 이후 빌릴게, 사물함, 행사의 관리자 기능도 같은 서비스에 계속 쌓여, 학생용 메서드와 운영진용 메서드가 구분되지 않습니다. 공지를 시작으로 분리 규칙을 정해 둡니다.⭐ 어떻게 해결했나요?
core:domain:welfare:AdminNoticeService(공개)와AdminNoticeServiceImpl(service.impl, package-private)을 추가했습니다. 메서드는search,getNotice,create,update,delete,changePinned이고, 로직은NoticeServiceImpl에서 그대로 옮겼습니다(수정 충돌 검사, 소프트 삭제, 아웃박스 기록, 트랜잭션 포함).NoticeService/NoticeServiceImpl: 학생용getNotices,getNotice만 남기고OutboxWriter의존을 뺐습니다.api:admin-api:AdminNoticeController,AdminNoticeReadUseCase,AdminNoticeWriteUseCase가AdminNoticeService를 씁니다. 파일 존재 확인 같은 도메인 조합은 이전처럼 UseCase가 맡습니다.coding-style.md의 이름 규칙 표에Admin{Domain}Service행을, 2-7절에 분리 규칙을 추가했습니다.동작 변경은 없고 위치만 옮긴 리팩토링입니다.
🧩 이 PR의 한계 & 트레이드오프
getNotice(공지 한 건 조회)가NoticeService와AdminNoticeService양쪽에 있습니다. 레이어 규칙 4번(같은 레이어 서비스끼리 호출하지 않음)에 따라 두 구현체가NoticeRepository를 각각 직접 쓰기 때문에findById+ 예외 변환 세 줄이 중복됩니다.StudentTransferStatusService.search/review등)는 그대로이고, 규칙 문서에도 "분리하기 전 도메인은{Domain}Service하나로 둔다"고 적었습니다.⛓️ 기존 기능에 미치는 영향
NoticeService에서create,update,delete,changePinned,search가 사라집니다. 이 메서드를 쓰던 곳은admin-api의 위 세 클래스뿐이고AdminNoticeService로 바꿨습니다. 학생 앱(AppNoticeController)은NoticeService.getNotices,getNotice만 써서 영향이 없습니다.🔀 Edge Case & 실패 시나리오
📋 검토한 대안과 선택 이유
admin-api에AdminNoticeService를 두기: 쓰기 로직이NoticeRepository, 트랜잭션, 아웃박스를 필요로 하는데 Presentation 계층은 저장소를 직접 참조하지 않아서, 결국 코어의NoticeService를 부르는 얇은 위임이 되고UseCase와 역할이 겹칩니다. 코어에 두었습니다.NoticeService하나로 유지: 가장 단순하지만 위에서 말한 대로 학생용과 운영진용이 계속 섞입니다.💬 리뷰 포인트
[r]이름과 위치 규칙(Admin{Domain}Service를 같은 도메인 모듈의service/service.impl에 둠)이 팀 방향과 맞는지. 이후 도메인에도 같은 규칙으로 갈 예정이라 먼저 정하면 좋습니다.[c]양쪽 서비스에getNotice가 중복되는 것을 받아들일지[a]coding-style.md의 규칙 문구