Skip to content

Conversation

@chaiminwoo0223
Copy link
Contributor

@chaiminwoo0223 chaiminwoo0223 commented Jan 5, 2026

📌 작업 내용 및 특이사항

✅ 변경 범위가 커진 이유

  • 이번 PR에서는 변경된 파일 수가 기존(약 110~120개) 대비 크게 증가했습니다.
  • Trip, Stamp가 현재 서비스 전반에서 공통적으로 사용되는 핵심 도메인이기 때문입니다.
  • Trip, Stamp Query / Command Service를 참조하는 Application 계층과 테스트 코드가 다수 존재하여, 마이그레이션 과정에서 관련 파일들이 함께 변경되었습니다.
  • 언어 전환 및 구조 정리로 인한 변경이 대부분이며, 삭제보다는 추가/변경된 파일 위주로 확인해 주시면 감사하겠습니다.

✅ Java → Kotlin 마이그레이션 개요

  • Stamp, DailyGoal, Trip 전반을 Java → Kotlin으로 마이그레이션했습니다.
  • 단순 문법 변환이 아니라, Kotlin–Java 혼용 환경에서도 안정적으로 동작하도록 구조를 정리하는 데 초점을 맞췄습니다.
  • 마이그레이션 과정에서 기존 로직의 의미가 변경되지 않도록, 정적 팩토리 메서드(of, from)도메인 책임 구조(Factory, Policy, Service, Facade)를 최대한 유지했습니다.

✅ 테스트 코드 Kotlin 마이그레이션

  • Java로 작성된 Stamp, DailyGoal, Trip 테스트 코드를 Kotlin으로 전환했습니다.
  • Kotlin–Java 혼용 환경에서 발생할 수 있는 접근자 차이(getter 인식 문제, record → data class 전환에 따른 호출 방식 변화 등)를 테스트 단계에서 먼저 확인했습니다.
  • Stamp, DailyGoal, Trip 도메인 전반에 대해 단위 테스트와 통합 테스트를 Kotlin 기준으로 정비했습니다.
  • Fixture는 object 사용을 지양하고, class + DSL(withXXX) 패턴으로 통일하여 테스트 간 상태 공유 문제를 해결했습니다.
  • 마이그레이션의 기준은 컴파일 성공이 아니라 모든 테스트 통과이며, 테스트가 통과하는 상태를 확인한 후에야 마이그레이션을 완료했습니다.

@JvmStatic 적용으로 인한 Java ↔ Kotlin 정적 호출 문제 해결

  • Kotlin 마이그레이션 과정에서 Java ↔ Kotlin 간 JVM 상호운용 방식 차이로 인해 정적 메서드 호출 이슈가 발생했습니다.
  • Kotlin의 object에 정의된 메서드는 JVM 레벨에서 기본적으로 INSTANCE.create() 형태로 노출됩니다.
  • 하지만, 기존 Java 코드 및 테스트 / Fixture에서는 xxxFactory.create() 형태의 정적(static) 호출 방식을 사용하고 있었습니다.
  • 이로 인해 Kotlin object로 전환 후, 일부 코드에서 컴파일 오류가 발생했습니다.
  • 이를 해결하기 위해 @JvmStatic을 적용하여, create() 메서드가 JVM 레벨의 static 메서드로 노출되도록 변경하여 문제를 해결했습니다.
  • 본 설정은 Java–Kotlin 혼용 구간에서의 호환성을 위한 임시 조치이며, Kotlin 마이그레이션이 모두 완료되면 @JvmStatic을 제거할 예정입니다.

✅ Stamp 도메인 Kotlin 마이그레이션

  • StampController Kotlin 전환
  • StampFacade, StampQueryService, StampCommandService Kotlin 전환
  • StampRepository, StampJpaRepository, StampRepositoryAdapter Kotlin 전환
  • StampErrorCode, StampPolicy Kotlin 전환
  • StampFactory Kotlin 전환

✅ DailyGoal 도메인 Kotlin 마이그레이션

  • DailyGoalController Kotlin 전환
  • DailyGoalFacade, DailyGoalQueryService, DailyGoalCommandService Kotlin 전환
  • DailyGoalRepository, DailyGoalJpaRepository, DailyGoalRepositoryAdapter Kotlin 전환
  • DailyGoalErrorCode, DailyGoalPolicy Kotlin 전환
  • DailyGoalFactory Kotlin 전환

✅ Trip 도메인 Kotlin 마이그레이션

  • TripController Kotlin 전환
  • TripFacade, TripQueryService, TripCommandService Kotlin 전환
  • TripRepository, TripJpaRepository, TripRepositoryAdapter Kotlin 전환
  • TripErrorCode, TripPolicy Kotlin 전환
  • TripFactory Kotlin 전환

✅ DTO Kotlin 마이그레이션

  • Stamp Application DTO: StampInfo, StampsInfo, StampDetail Kotlin 전환

  • Stamp Presentation Reqeust DTO: CreateStampRequest, UpdateStampRequest, UpdateStampOrderRequest Kotlin 전환

  • Stamp Presentation Response DTO: CreateStampResponse, LoadStampInfoResponse, LoadStampDetailResponse Kotlin 전환

  • DailyGoal Application DTO: DailyGoalInfo, DailyGoalDetail Kotlin 전환

  • DailyGoal Presentation Reqeust DTO: CreateDailyGoalRequest, UpdateDailyGoalRequest Kotlin 전환

  • DailyGoal Presentation Response DTO: CreateDailyGoalResponse, LoadDailyGoalDetailResponse Kotlin 전환

  • Trip Application DTO: CategoryInfo, TripInfo, TripDetail, TripSliceInfo, TripCount Kotlin 전환

  • Trip Presentation Reqeust DTO: CreateTripRequest, UpdateTripRequest Kotlin 전환

  • Trip Presentation Response DTO: CreateTripResponse, LoadTripCategoryResponse, LoadTripsSliceResponse, LoadTripDetailResponse Kotlin 전환


🌱 관련 이슈


🔍 참고사항(선택)

  • Kotlin–Java 혼용 환경에서 안정적인 접근을 위해 TripCategory에 명시적 getter 추가
  • MissionFacade.getMissionsByStamp()에서 MISSIONS 캐싱 적용
  • CreatePomodoroRequestFixture.kt에 withFocusDurationInMinute, withFocusSessionCount 메서드 추가
  • DummyStampCommandServiceTest CreateDummyStamp 단위 테스트 수정

📚 기타(선택)

@chaiminwoo0223 chaiminwoo0223 self-assigned this Jan 5, 2026
@chaiminwoo0223 chaiminwoo0223 added the 🪄refactor 기능 개선 및 리팩토링 label Jan 5, 2026
* feat: StampController.kt 구현
* feat: StampFacade.kt 구현
* feat: StampQueryService.kt, StampCommandService.kt 구현
* feat: StampRepository.kt, StampJpaRepository.kt, StampRepositoryAdapter.kt 구현
* feat: StampErrorCode.kt, StampPolicy.kt 구현
* feat: StampFactory.kt 구현

* feat: DailyGoalController.kt 구현
* feat: DailyGoalFacade.kt 구현
* feat: DailyGoalQueryService.kt, DailyGoalCommandService.kt 구현
* feat: DailyGoalRepository.kt, DailyGoalJpaRepository.kt, DailyGoalRepositoryAdapter.kt 구현
* feat: DailyGoalErrorCode.kt, DailyGoalPolicy.kt 구현
* feat: DailyGoalPolicy.kt 구현

* feat: TripController.kt 구현
* feat: TripFacade.kt 구현
* feat: TripQueryService.kt, TripCommandService.kt 구현
* feat: TripRepository.kt, TripJpaRepository.kt, TripRepositoryAdapter.kt 구현
* feat: TripErrorCode.kt, TripPolicy.kt 구현
* feat: TripFactory.kt 구현

* feat: CreateStampRequest.kt, UpdateStampRequest.kt, UpdateStampOrderRequest.kt DTO 추가
* feat: CreateStampResponse.kt, LoadStampDetailResponse.kt, LoadStampInfoResponse.kt DTO 추가
* feat: StampInfo.kt, StampsInfo.kt, StampDetail.kt DTO 추가

* feat: CreateDailyGoalRequest.kt, UpdateDailyGoalRequest.kt DTO 추가
* feat: CreateDailyGoalResponse.kt, LoadDailyGoalDetailResponse.kt DTO 추가
* feat: DailyGoalInfo.kt, DailyGoalDetail.kt DTO 추가

* feat: CreateTripRequest.kt, UpdateTripRequest.kt DTO 추가
* feat: CreateTripResponse.kt, LoadTripCategoryResponse.kt, LoadTripsSliceResponse.kt, LoadTripDetailResponse.kt DTO 추가
* feat: TripCategoryInfo.kt, TripInfo.kt, TripDetail.kt, TripSliceInfo.kt, TripCount.kt DTO 추가

* refactor: java stamp 관련 패키지 제거 (Kotlin 마이그레이션 완료)
* refactor: Kotlin–Java 혼용 환경에서 안정적인 접근을 위해 TripCategory에 명시적 getter 추가

* test: StampFixture.kt, CreateStampRequestFixture.kt, UpdateStampRequestFixture.kt, UpdateStampOrderRequestFixture.kt 추가
* test: StampTestHelper.kt 추가
* test: StampQueryServiceTest.kt, StampCommandServiceTest.kt 단위 테스트 추가
* test: StampControllerIntegrationTest.kt 통합 테스트 추가

* test: DailyGoalFixture.kt, CreateDailyGoalRequestFixture.kt, UpdateDailyGoalRequestFixture.kt 추가
* test: DailyGoalTestHelper.kt 추가
* test: DailyGoalQueryServiceTest.kt, DailyGoalCommandServiceTest.kt 단위 테스트 추가
* test: DailyGoalControllerIntegrationTest.kt 통합 테스트 추가

* test: TripFixture.kt, CreateTripRequestFixture.kt, UpdateTripRequestFixture.kt 추가
* test: TripTestHelper.kt 추가
* test: TripQueryServiceTest.kt, TripCommandServiceTest.kt 단위 테스트 추가
* test: TripControllerIntegrationTest.kt 통합 테스트 추가

* test: test java stamp 패키지 제거 (Kotlin 마이그레이션 완료)
* test: CreatePomodoroRequestFixture.kt에 withFocusDurationInMinute, withFocusSessionCount 메서드 추가
* test: DummyStampCommandServiceTest CreateDummyStamp 단위 테스트 수정

* fix: MissionFacade.getMissionsByStamp()에서 MISSIONS 캐싱 적용
Copy link
Contributor

@hisonghy hisonghy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

변경 내용이 어마어마하군요..!
정말 고생하셨습니다!

@chaiminwoo0223 chaiminwoo0223 merged commit 26204f0 into develop Jan 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🪄refactor 기능 개선 및 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🪄[REFACTOR]: Stamp, DailyGoal, Trip 기능 전반 Kotlin 마이그레이션

3 participants