-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: Service 클래스에 CQRS 패턴 및 Redis 적용(#75) #77
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
Merged
Conversation
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
7aa8def to
0f3f4b9
Compare
* feat: MemberService를 삭제하고, MemberQueryService, MemberCommandService 구현 * feat: TripService를 삭제하고, TripQueryService, TripCommandService 구현 * feat: StampService를 삭제하고, StampQueryService, StampCommandService 구현 * feat: MissionService를 삭제하고, MissionQueryService, MissionCommandService 구현 * feat: StudyLogService를 삭제하고, StudyLogQueryService, StudyLogCommandService 구현 * feat: DailyMissionService를 삭제하고, DailyMissionQueryService, DailyMissionCommandService 구현 * feat: StudyLogDailyMissionService를 삭제하고, StudyLogDailyMissionQueryService, StudyLogDailyMissionCommandService 구현 * feat: DailyGoalService를 삭제하고, DailyGoalQueryService, DailyGoalCommandService 구현 * feat: PomodoroService를 삭제하고, PomodoroQueryService, PomodoroCommandService 구현 * feat: DailyGoal에 updateCompleted 메서드 추가 * feat: MemberFacade, TripFacade, StampFacade, MissionFacade, DailyGoalFacade, HardDeleteFacade 각 메서드에 트랜잭션 적용 * refactor: MemberService, TripService, StampService, MissionService에서 @transactional 어노테이션 제거 * refactor: DailyGoalService, DailyMissionService에서 @transactional 어노테이션 제거 * refactor: PomodoroService, StudyLogService, StudyLogDailyMissionService에서 @transactional 어노테이션 제거 * refactor: Facade 조회 메서드에 @Cacheable 및 등록, 수정, 삭제 메서드에 @CacheEvict 적용 * refactor: Facade에서 @service 어노테이션 -> @component 어노테이션 변경 * refactor: MemberQueryRepository, MemberQueryRepositoryAdapter에서 findMemberRoleById 메서드 반환 타입 변경 * refactor: TripCount -> TripCountInfo 이름 변경 * refactor: BatchJobConfig에서 Step/Tasklet 처리 로직을 제거하고, BatchStepConfig 및 HardDeleteTasklet 추가 * refactor: SchedulerConfig에서 배치 스케줄러 작업 로직을 BatchJobScheduler로 분리 * refactor: RedisCacheConfig 추가 및 TTL 전략 반영 * refactor: CacheNameConstants, CacheKeyFactory 추가 * test: MemberServiceTest를 삭제하고, MemberQueryServiceTest, MemberCommandServiceTest 단위 테스트 추가 * test: TripServiceTest를 삭제하고, TripQueryServiceTest, TripCommandServiceTest 단위 테스트 추가 * test: StampServiceTest를 삭제하고, StampQueryServiceTest, StampCommandServiceTest 단위 테스트 추가 * test: MissionServiceTest를 삭제하고, MissionQueryServiceTest, MissionCommandServiceTest 단위 테스트 추가 * test: StudyLogServiceTest를 삭제하고, StudyLogQueryServiceTest, StudyLogCommandServiceTest 단위 테스트 추가 * test: DailyMissionTest를 삭제하고, DailyMissionQueryServiceTest, DailyMissionCommandServiceTest 단위 테스트 추가 * test: StudyLogDailyMissionServiceTest를 삭제하고, StudyLogDailyMissionQueryServiceTest, StudyLogDailyMissionCommandServiceTest 단위 테스트 추가 * test: DailyGoalServiceTest를 삭제하고, DailyGoalQueryServiceTest, DailyGoalCommandServiceTest 단위 테스트 추가 * test: PomodoroServiceTest를 삭제하고, PomodoroQueryServiceTest, PomodoroCommandServiceTest 단위 테스트 추가 * test: UpdateStampOrderRequestFixture 추가 * test: DailyGoalFixture에서 createDeletedDailyGoal 메서드 삭제
0f3f4b9 to
9ce92dc
Compare
hisonghy
reviewed
Oct 12, 2025
src/main/java/com/ject/studytrip/global/batch/scheduler/BatchJobScheduler.java
Show resolved
Hide resolved
hisonghy
reviewed
Oct 12, 2025
src/main/java/com/ject/studytrip/member/application/facade/MemberFacade.java
Show resolved
Hide resolved
hisonghy
reviewed
Oct 12, 2025
src/main/java/com/ject/studytrip/member/application/service/MemberCommandService.java
Show resolved
Hide resolved
hisonghy
reviewed
Oct 12, 2025
Contributor
hisonghy
left a comment
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.
코드 리뷰 작성했습니다. 확인 부탁드려요!
hisonghy
approved these changes
Oct 12, 2025
Contributor
hisonghy
left a comment
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.
정말 고생많으셨습니다.
머지부탁드려요!
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.
📌 작업 내용 및 특이사항
✅ Service 클래스 CQRS 패턴 적용
Query/Command 패턴으로 분리하여 책임 명확화MemberService삭제 ->MemberQueryService,MemberCommandService구현TripService삭제 ->TripQueryService,TripCommandService구현StampService삭제 ->StampQueryService,StampCommandService구현MissionService삭제 ->MissionQueryService,MissionCommandService구현StudyLogService삭제 ->StudyLogQueryService,StudyLogCommandService구현DailyMissionService삭제 ->DailyMissionQueryService,DailyMissionCommandService구현StudyLogDailyMissionService삭제 ->StudyLogDailyMissionQueryService,StudyLogDailyMissionCommandService구현DailyGoalService삭제 ->DailyGoalQueryService,DailyGoalCommandService구현PomodoroService삭제 ->PomodoroQueryService,PomodoroCommandService구현✅ Facade 클래스 트랜잭션 관리 개선
@Transactional 어노테이션을 Facade로 모두 이동하여, 비즈니스 단위로 트랜잭션 처리 및 관리MemberFacade,TripFacade,StampFacade,HardDeleteFacade등 각 메서드에@Transactional 어노테이션을 적용@Transactional 어노테이션제거✅ Redis 캐싱 적용
RedisCacheConfig를 적용하여 도메인 별 TTL 전략 반영CacheNameConstants,CacheKeyFactory를 추가하여 캐시 키 관리 체계화Facade 조회 메서드에@Cacheable 어노테이션을 적용하여 조회 성능 개선Facade 등록, 수정, 삭제 메서드에@CacheEvict 어노테이션을 적용하여 캐시 무효화 적용✅ 도메인 및 레포지토리 개선
DailyGoal:updateCompleted()추가MemberQueryRepository, MemberQueryRepositoryAdapter:findMemberRoleById()반환 타입을 Optional로 변경테스트
MemberServiceTest삭제 ->MemberQueryServiceTest,MemberCommandServiceTest단위 테스트 추가TripServiceTest삭제 ->TripQueryServiceTest,TripCommandServiceTest단위 테스트 추가StampServiceTest삭제 ->StampQueryServiceTest,StampCommandServiceTest단위 테스트 추가MissionServiceTest삭제 ->MissionQueryServiceTest,MissionCommandServiceTest단위 테스트 추가StudyLogServiceTest삭제 ->StudyLogQueryServiceTest,StudyLogCommandServiceTest단위 테스트 추가DailyMissionTest삭제 ->DailyMissionQueryServiceTest,DailyMissionCommandServiceTest단위 테스트 추가StudyLogDailyMissionServiceTest삭제 ->StudyLogDailyMissionQueryServiceTest,StudyLogDailyMissionCommandServiceTest단위 테스트 추가DailyGoalServiceTest삭제 ->DailyGoalQueryServiceTest,DailyGoalCommandServiceTest단위 테스트 추가PomodoroServiceTest삭제 ->PomodoroQueryServiceTest,PomodoroCommandServiceTest단위 테스트 추가UpdateStampOrderRequestFixture추가DailyGoalFixture.createDeletedDailyGoal()삭제🌱 관련 이슈
🔍 참고사항(선택)
@Service 어노테이션->@Component 어노테이션변경TripCount->TripCountInfo이름 변경BatchJobConfig에서Step/Tasklet 처리 로직을 제거하고,BatchStepConfig및HardDeleteTasklet추가SchedulerConfig에서 배치 스케줄러 작업 로직을BatchJobScheduler로 분리📚 기타(선택)