-
Notifications
You must be signed in to change notification settings - Fork 2
[Feat] 메인화면의 수정된 API를 반영합니다. #104
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
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
- 메인화면 데이터 fetch API 변경에 따라 DTO 구조 변경 - 레포지토리, 유즈케이스, 뷰모델 코드 수정
- PopupMainListResponsdeDTO 수정 - PopupPreviewResponseDTO 수정
서버에서 받은 문자열을 통해 InterestCategory로 변환하기 위해
snughnu
reviewed
May 2, 2025
Contributor
snughnu
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.
확인했습니다~~
Popcorn-iOS/Source/Data/DTO/MainScene/MainScene/ClosingSoonPopupResponseDTO.swift
Show resolved
Hide resolved
Popcorn-iOS/Source/Data/DTO/MainScene/MainScene/PopupMainListResponseDTO.swift
Show resolved
Hide resolved
snughnu
approved these changes
May 2, 2025
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.
배경
메인화면 팝업스토어 데이터 API 변경에 따른 로직 수정과 지금 놓치면 안 될 팝업스토어 페이지네이션 추가
작업 내용
1. 메인화면 API 변경
필드 추가
메인화면 API에 페이지네이션을 위해
totalPages,currentPages필드가 추가되었습니다.PopupMainListResponseDTO에 해당 필드를 추가하고, 레포지토리, 유즈케이스, 뷰모델의 로직을 이에 맞춰 변경하였습니다.
totalPages와currentPages를 비교해, 다음 페이지가 있는지 뷰모델까지 전달합니다.PopupListRepository의
fetchPopupMainList메서드 로직 수정기존 API에서는 **캐러셀 이미지(오늘의 추천 팝업)**와 이외 팝업 데이터가 서로 다른 API를 통해 응답받도록 설계되어있었습니다.
현재는 두 데이터 모두 하나의 엔드포인트에서 받을 수 있도록 변경되었습니다.
따라서
DispatchGroup을 이용해 두 개의 비동기 요청을 보내는 로직을 모두 제거하고, 단일 요청을 보내도록 수정하였습니다.2. 지금 놓치면 안 될 팝업스토어 페이지네이션 추가
/popups/homepath의 쿼리 파라미터에 값이 1이라면 메인화면의 전체 데이터를 서버에서 주고, 1이 아니라면 지금 놓치면 안 될 팝업스토어의 데이터만 주도록 설계되어있습니다.두 요청을 분리하기 위해 별개의 메서드로 구현하였습니다.
fetchPopupMainList()fetchClosingSoonPopup()3. InterestCategoryDTO 생성자 추가
서버에서 받은 관심사 문자열을
InterestCategory로 변경하는 작업은InterestCategoryDTO에서 수행합니다.InterestCategroyDTO를 관심사 문자열로 초기화 할 수 있도록 생성자를 추가하였습니다.테스트 방법 및 리뷰 노트
API 요청과 응답은 정상적으로 작동하지만, 메인화면에 데이터가 표시되지 않고 있습니다...
MainSceneDataSource까지 저장은 정상적으로 되더라구요ㅠㅠ메인 화면의 프레젠테이션 레이어의 리팩토링이 필요할 것 같아 현재 작업 내용만 먼저 PR 올립니다!