Skip to content

Conversation

@hisonghy
Copy link
Contributor

@hisonghy hisonghy commented Oct 14, 2025

📌 작업 내용 및 특이사항

✅ Slice/List 타입 반환 -> DTO 반환으로 변경

  • @Cacheable이 적용된 메서드 중 목록 데이터를 캐싱하는 메서드에서 역직렬화에 실패하는 오류가 발생했습니다.
[nio-8080-exec-3] c.j.s.g.e.h.GlobalExceptionHandler       : Internal Server Error : Could not read JSON:Unexpected token (START_OBJECT), expected VALUE_STRING: need String, Number of Boolean value that contains type id (for subtype of java.lang.Object)
 at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 2]
org.springframework.data.redis.serializer.SerializationException: Could not read JSON:Unexpected token (START_OBJECT), expected VALUE_STRING: need String, Number of Boolean value that contains type id (for subtype of java.lang.Object)
 at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 2]
  • 목록 반환을 Slice/List -> 래퍼 DTO로 전환해 반환하도록 해 캐시 값 타입을 일치시켰습니다. (TripSliceInfo, StudyLogSliceInfo, StampsInfo, MissionsInfo)
  • 모두 DTO 타입으로 변환하고 로컬에서 테스트를 수행한 결과, 여러번 조회 요청에도 오류없이 성공하는 걸 확인했습니다.

🌱 관련 이슈


🔍 참고사항(선택)

  • 지금은 우선 빠르게 변경 사항을 적용시키고, 추후 발생했던 역직렬화에 대한 예외와 원인을 좀 더 세세히 분석해 해당 PR에 적어두겠습니다.

📚 기타(선택)

* feat: TripSliceInfo dto 추가
* feat: StudyLogSliceInfo dto 추가
* feat: StampsInfo dto 추가
* feat: MissionsInfo dto 추가

* fix: '@Cacheable'이 적용된 캐시 대상 메서드의 Slice<T>/List<T> 반환 -> DTO 반환으로 수정
(TripFacade.getTripsByMember, StudyLogFacade.getStudyLogsByTrip, StampFacade.getStampsByTrip, MissionFacade.getMissionsByStamp)
@hisonghy hisonghy self-assigned this Oct 14, 2025
@hisonghy hisonghy added 🐛bug 버그 발견 및 수정/해결 🪄refactor 기능 개선 및 리팩토링 labels Oct 14, 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.

저도 목록 조회 API를 구현할 때 참고해서 구현하겠습니다.
고생하셨습니다. 머지 부탁드립니다!

@hisonghy hisonghy closed this Oct 14, 2025
@hisonghy hisonghy reopened this Oct 14, 2025
@hisonghy hisonghy merged commit 1f5eda5 into develop Oct 14, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛bug 버그 발견 및 수정/해결 🪄refactor 기능 개선 및 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛️[BUG]: 캐싱된 목록 데이터 역직렬화 실패 문제 해결

3 participants