Skip to content

refactor: 여행 정보 조회 시 getTrip → getValidTrip로 통합 리팩토링(#30)#31

Merged
hisonghy merged 1 commit intodevelopfrom
refactor/30
Jul 15, 2025
Merged

refactor: 여행 정보 조회 시 getTrip → getValidTrip로 통합 리팩토링(#30)#31
hisonghy merged 1 commit intodevelopfrom
refactor/30

Conversation

@hisonghy
Copy link
Contributor

📌 작업 내용 및 특이사항

✅ 여행 조회 로직을 getValidTrip() 으로 통합

  • 기존에는 getTrip() 메서드로 삭제 여부만 검증하고 소유자 검증은 각 기능에서 별도로 수행했지만, 중복된 코드를 줄이고 각 역할을 분리하기 위해 getValidTrip() 메서드 하나에서 삭제 여부 및 소유자 검증을 모두 수행하도록 변경하고, 검증된 여행 정보가 필요한 모든 곳에서 getValidTrip() 메서드를 사용하도록 리팩토링
  • getValidTrip() 메서드는 검증을 수행해 유효한 여행 정보 조회 역할을 담당하고, getTrip() 메서드는 단순 여행 조회 용도로 역할을 분리

✅ TripServiceTest 및 TripControllerIntegrationTest 수정

  • 중복된 검증 로직을 제거하면서 TripServiceTest 내 관련 테스트 제거
  • 여행 상세 조회 시 소유자 검증 테스트TripServiceTestTripControllerIntegrationTest에 추가

🌱 관련 이슈


🔍 참고사항(선택)


📚 기타(선택)

@hisonghy hisonghy requested a review from chaiminwoo0223 July 15, 2025 12:46
@hisonghy hisonghy self-assigned this Jul 15, 2025
@hisonghy hisonghy added the 🪄refactor 기능 개선 및 리팩토링 label Jul 15, 2025
Copy link
Contributor

@chaiminwoo0223 chaiminwoo0223 left a comment

Choose a reason for hiding this comment

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

고생 많으셨습니다. 코드 리뷰 확인해주시면 감사하겠습니다. 피드백도 부탁드려요~^^

Copy link
Contributor

@chaiminwoo0223 chaiminwoo0223 left a comment

Choose a reason for hiding this comment

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

변경된 내용 모두 확인했습니다. 머지 부탁드려요!

* refactor: 유효한 여행 정보가 필요한 로직에 getValidTrip() 메서드를 사용하도록 통일하고 중복된 검증 로직 제거
* test: 중복 검증 제거에 따라 TripServiceTest 내 관련 테스트 제거
* test: 여행 상세 조회 시 소유자 검증 테스트를 TripServiceTest 및 TripControllerIntegrationTest에 추가
@hisonghy hisonghy merged commit d2c7494 into develop Jul 15, 2025
1 check 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]: 여행 정보 조회 시 중복된 검증 제거를 위해 getTrip() -> getValidTrip() 으로 통합 리팩토링

2 participants