From fe875b5ed0b96e1e83eec901d578537981cb53de Mon Sep 17 00:00:00 2001 From: JunYoung Date: Sun, 9 Feb 2025 16:00:38 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[FEAT]:=20=EC=BD=94=EB=A9=98=ED=8A=B8=20?= =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=ED=99=94=EB=A9=B4=20=EB=82=B4=20?= =?UTF-8?q?=EC=BD=94=EB=A9=98=ED=8A=B8=20=EB=A9=94=EB=89=B4=20=EB=B6=84?= =?UTF-8?q?=EA=B8=B0=20=EC=A0=81=EC=9A=A9,=20=EB=8B=A4=EB=A5=B8=20?= =?UTF-8?q?=EC=9C=A0=EC=A0=80=EA=B0=80=20=EC=BD=94=EB=A9=98=ED=8A=B8=20?= =?UTF-8?q?=ED=95=9C=20=ED=8C=9D=EC=97=85=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Poppool/Poppool.xcodeproj/project.pbxproj | 16 ++--- .../GetOtherUserCommentListResponseDTO.swift | 61 ---------------- ...herUserCommentedPopUpListResponseDTO.swift | 45 ++++++++++++ .../Network/UserAPI/UserAPIEndPoint.swift | 2 +- .../Repository/UserAPIRepositoryImpl.swift | 4 +- .../GetOtherUserCommentListResponse.swift | 29 -------- ...tOtherUserCommentedPopUpListResponse.swift | 22 ++++++ .../Domain/UseCase/UserAPIUseCaseImpl.swift | 4 +- .../CommentList/CommentListReactor.swift | 8 ++- .../OtherUserCommentController.swift | 22 +----- .../OtherUserCommentReactor.swift | 71 +++++-------------- .../View/OtherUserCommentView.swift | 1 + 12 files changed, 106 insertions(+), 179 deletions(-) delete mode 100644 Poppool/Poppool/Data/Network/UserAPI/ResponseDTO/GetOtherUserCommentListResponseDTO.swift create mode 100644 Poppool/Poppool/Data/Network/UserAPI/ResponseDTO/GetOtherUserCommentedPopUpListResponseDTO.swift delete mode 100644 Poppool/Poppool/Domain/Entities/GetOtherUserCommentListResponse.swift create mode 100644 Poppool/Poppool/Domain/Entities/GetOtherUserCommentedPopUpListResponse.swift diff --git a/Poppool/Poppool.xcodeproj/project.pbxproj b/Poppool/Poppool.xcodeproj/project.pbxproj index 6d9dbf11..78a56794 100644 --- a/Poppool/Poppool.xcodeproj/project.pbxproj +++ b/Poppool/Poppool.xcodeproj/project.pbxproj @@ -215,8 +215,8 @@ 086F89D52D1E6DB100CA4FC9 /* OtherUserCommentController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 086F89D42D1E6DB100CA4FC9 /* OtherUserCommentController.swift */; }; 086F89D72D1E6DB700CA4FC9 /* OtherUserCommentReactor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 086F89D62D1E6DB700CA4FC9 /* OtherUserCommentReactor.swift */; }; 086F89D92D1E79E200CA4FC9 /* GetOtherUserCommentListRequestDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 086F89D82D1E79E200CA4FC9 /* GetOtherUserCommentListRequestDTO.swift */; }; - 086F89DB2D1E7A6C00CA4FC9 /* GetOtherUserCommentListResponseDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 086F89DA2D1E7A6C00CA4FC9 /* GetOtherUserCommentListResponseDTO.swift */; }; - 086F89E02D1E7CC700CA4FC9 /* GetOtherUserCommentListResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 086F89DF2D1E7CC700CA4FC9 /* GetOtherUserCommentListResponse.swift */; }; + 086F89DB2D1E7A6C00CA4FC9 /* GetOtherUserCommentedPopUpListResponseDTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 086F89DA2D1E7A6C00CA4FC9 /* GetOtherUserCommentedPopUpListResponseDTO.swift */; }; + 086F89E02D1E7CC700CA4FC9 /* GetOtherUserCommentedPopUpListResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 086F89DF2D1E7CC700CA4FC9 /* GetOtherUserCommentedPopUpListResponse.swift */; }; 086F89E42D1FE91300CA4FC9 /* OtherUserCommentSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 086F89E32D1FE91300CA4FC9 /* OtherUserCommentSection.swift */; }; 086F89E62D1FE91800CA4FC9 /* OtherUserCommentSectionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 086F89E52D1FE91800CA4FC9 /* OtherUserCommentSectionCell.swift */; }; 086F89EA2D2009E300CA4FC9 /* SubLoginView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 086F89E92D2009E300CA4FC9 /* SubLoginView.swift */; }; @@ -707,8 +707,8 @@ 086F89D42D1E6DB100CA4FC9 /* OtherUserCommentController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OtherUserCommentController.swift; sourceTree = ""; }; 086F89D62D1E6DB700CA4FC9 /* OtherUserCommentReactor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OtherUserCommentReactor.swift; sourceTree = ""; }; 086F89D82D1E79E200CA4FC9 /* GetOtherUserCommentListRequestDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GetOtherUserCommentListRequestDTO.swift; sourceTree = ""; }; - 086F89DA2D1E7A6C00CA4FC9 /* GetOtherUserCommentListResponseDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GetOtherUserCommentListResponseDTO.swift; sourceTree = ""; }; - 086F89DF2D1E7CC700CA4FC9 /* GetOtherUserCommentListResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GetOtherUserCommentListResponse.swift; sourceTree = ""; }; + 086F89DA2D1E7A6C00CA4FC9 /* GetOtherUserCommentedPopUpListResponseDTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GetOtherUserCommentedPopUpListResponseDTO.swift; sourceTree = ""; }; + 086F89DF2D1E7CC700CA4FC9 /* GetOtherUserCommentedPopUpListResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GetOtherUserCommentedPopUpListResponse.swift; sourceTree = ""; }; 086F89E32D1FE91300CA4FC9 /* OtherUserCommentSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OtherUserCommentSection.swift; sourceTree = ""; }; 086F89E52D1FE91800CA4FC9 /* OtherUserCommentSectionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OtherUserCommentSectionCell.swift; sourceTree = ""; }; 086F89E92D2009E300CA4FC9 /* SubLoginView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubLoginView.swift; sourceTree = ""; }; @@ -2048,7 +2048,7 @@ 086F89DD2D1E7A7A00CA4FC9 /* ResponseDTO */ = { isa = PBXGroup; children = ( - 086F89DA2D1E7A6C00CA4FC9 /* GetOtherUserCommentListResponseDTO.swift */, + 086F89DA2D1E7A6C00CA4FC9 /* GetOtherUserCommentedPopUpListResponseDTO.swift */, 081898C22D30AE2C0067BF01 /* GetMyProfileResponseDTO.swift */, 086F89F62D226DF600CA4FC9 /* GetMyPageResponseDTO.swift */, 081898AD2D2CFC230067BF01 /* GetWithdrawlListResponseDTO.swift */, @@ -2064,7 +2064,7 @@ 086F89DE2D1E7CBE00CA4FC9 /* UserAPI */ = { isa = PBXGroup; children = ( - 086F89DF2D1E7CC700CA4FC9 /* GetOtherUserCommentListResponse.swift */, + 086F89DF2D1E7CC700CA4FC9 /* GetOtherUserCommentedPopUpListResponse.swift */, 086F89F82D226EEB00CA4FC9 /* GetMyPageResponse.swift */, 081898AF2D2CFCA40067BF01 /* GetWithdrawlListResponse.swift */, 081898C42D30AEF40067BF01 /* GetMyProfileResponse.swift */, @@ -3384,7 +3384,7 @@ 086F89D72D1E6DB700CA4FC9 /* OtherUserCommentReactor.swift in Sources */, 083C867A2D0EE3BB003F441C /* CommentAPIUseCaseImpl.swift in Sources */, 4E7823A82D2E84E800AC5110 /* AdminRepository.swift in Sources */, - 086F89DB2D1E7A6C00CA4FC9 /* GetOtherUserCommentListResponseDTO.swift in Sources */, + 086F89DB2D1E7A6C00CA4FC9 /* GetOtherUserCommentedPopUpListResponseDTO.swift in Sources */, 086F89D32D1E6DA600CA4FC9 /* OtherUserCommentView.swift in Sources */, 4E685ECE2D12CEB6001EF91C /* BalloonBackgroundView.swift in Sources */, 4E755B292D2BA65A00ADFB21 /* AdminReactor.swift in Sources */, @@ -3442,7 +3442,7 @@ 08B191912CF4A00E0057BC04 /* SignUpStep3Reactor.swift in Sources */, 083A259C2CF362090099B58E /* InOutputable.swift in Sources */, 089952642D0366DA0022AEF9 /* SearchMainReactor.swift in Sources */, - 086F89E02D1E7CC700CA4FC9 /* GetOtherUserCommentListResponse.swift in Sources */, + 086F89E02D1E7CC700CA4FC9 /* GetOtherUserCommentedPopUpListResponse.swift in Sources */, BD9103652CF6149D00BBCCAE /* HomeAPIEndpoint.swift in Sources */, 086DD8E32CFF356300B97D3B /* HomeCardGridSection.swift in Sources */, 0841BABE2CFB5AA600049E31 /* Date?+.swift in Sources */, diff --git a/Poppool/Poppool/Data/Network/UserAPI/ResponseDTO/GetOtherUserCommentListResponseDTO.swift b/Poppool/Poppool/Data/Network/UserAPI/ResponseDTO/GetOtherUserCommentListResponseDTO.swift deleted file mode 100644 index 452a4017..00000000 --- a/Poppool/Poppool/Data/Network/UserAPI/ResponseDTO/GetOtherUserCommentListResponseDTO.swift +++ /dev/null @@ -1,61 +0,0 @@ -// -// GetOtherUserCommentListResponseDTO.swift -// Poppool -// -// Created by SeoJunYoung on 12/27/24. -// - -import Foundation - -struct GetOtherUserCommentListResponseDTO: Decodable { - var commentList: [GetOtherUserCommentResponseDTO] - var totalPages: Int32 - var totalElements: Int64 -} - -extension GetOtherUserCommentListResponseDTO { - func toDomain() -> GetOtherUserCommentListResponse { - return .init(commentList: commentList.map { $0.toDomain() }, totalPages: totalPages, totalElements: totalElements) - } -} - -struct GetOtherUserCommentResponseDTO: Decodable { - var commentId: Int64 - var content: String? - var likeCount: Int64 - var createDateTime: String? - var popUpStoreInfo: GetOtherUserCommentPopUpResponseDTO -} - -extension GetOtherUserCommentResponseDTO { - func toDomain() -> GetOtherUserCommentResponse { - return .init( - commentId: commentId, - content: content, - likeCount: likeCount, - createDateTime: createDateTime.toDate().toPPDateString(), - popUpStoreInfo: popUpStoreInfo.toDomain() - ) - } -} - -struct GetOtherUserCommentPopUpResponseDTO: Decodable { - var popUpStoreId: Int64 - var popUpStoreName: String? - var mainImageUrl: String? - var closeYn: Bool -} - -extension GetOtherUserCommentPopUpResponseDTO { - func toDomain() -> GetOtherUserCommentPopUpResponse { - return .init( - popUpStoreId: popUpStoreId, - popUpStoreName: popUpStoreName, - mainImageUrl: mainImageUrl, - closeYn: closeYn - ) - } -} - - - diff --git a/Poppool/Poppool/Data/Network/UserAPI/ResponseDTO/GetOtherUserCommentedPopUpListResponseDTO.swift b/Poppool/Poppool/Data/Network/UserAPI/ResponseDTO/GetOtherUserCommentedPopUpListResponseDTO.swift new file mode 100644 index 00000000..7bafcdad --- /dev/null +++ b/Poppool/Poppool/Data/Network/UserAPI/ResponseDTO/GetOtherUserCommentedPopUpListResponseDTO.swift @@ -0,0 +1,45 @@ +// +// GetOtherUserCommentedPopUpListResponseDTO.swift +// Poppool +// +// Created by SeoJunYoung on 12/27/24. +// + +import Foundation + +struct GetOtherUserCommentedPopUpListResponseDTO: Decodable { + var popUpInfoList: [GetOtherUserCommentedPopUpResponseDTO] +} + +extension GetOtherUserCommentedPopUpListResponseDTO { + func toDomain() -> GetOtherUserCommentedPopUpListResponse { + return .init(popUpInfoList: popUpInfoList.map { $0.toDomain() }) + } +} + +struct GetOtherUserCommentedPopUpResponseDTO: Decodable { + var popUpStoreId: Int64 + var popUpStoreName: String? + var desc: String? + var startDate: String? + var endDate: String? + var address: String? + var closedYn: Bool +} + +extension GetOtherUserCommentedPopUpResponseDTO { + func toDomain() -> GetOtherUserCommentedPopUpResponse { + return .init( + popUpStoreId: popUpStoreId, + popUpStoreName: popUpStoreName, + desc: desc, + startDate: startDate.toDate().toPPDateString(), + endDate: endDate.toDate().toPPDateString(), + address: address, + closedYn: closedYn + ) + } +} + + + diff --git a/Poppool/Poppool/Data/Network/UserAPI/UserAPIEndPoint.swift b/Poppool/Poppool/Data/Network/UserAPI/UserAPIEndPoint.swift index 1cc1c19f..fce30a7d 100644 --- a/Poppool/Poppool/Data/Network/UserAPI/UserAPIEndPoint.swift +++ b/Poppool/Poppool/Data/Network/UserAPI/UserAPIEndPoint.swift @@ -65,7 +65,7 @@ struct UserAPIEndPoint { ) } - static func getOtherUserCommentList(request: GetOtherUserCommentListRequestDTO) -> Endpoint { + static func getOtherUserCommentPopUpList(request: GetOtherUserCommentListRequestDTO) -> Endpoint { return Endpoint( baseURL: Secrets.popPoolBaseUrl.rawValue, path: "/users/\(request.commenterId ?? "")/comments", diff --git a/Poppool/Poppool/Data/Repository/UserAPIRepositoryImpl.swift b/Poppool/Poppool/Data/Repository/UserAPIRepositoryImpl.swift index 04c3eb3f..5e4cdab2 100644 --- a/Poppool/Poppool/Data/Repository/UserAPIRepositoryImpl.swift +++ b/Poppool/Poppool/Data/Repository/UserAPIRepositoryImpl.swift @@ -48,8 +48,8 @@ final class UserAPIRepositoryImpl { return provider.request(with: endPoint, interceptor: tokenInterceptor) } - func getOtherUserCommentList(request: GetOtherUserCommentListRequestDTO) -> Observable { - let endPoint = UserAPIEndPoint.getOtherUserCommentList(request: request) + func getOtherUserCommentList(request: GetOtherUserCommentListRequestDTO) -> Observable { + let endPoint = UserAPIEndPoint.getOtherUserCommentPopUpList(request: request) return provider.requestData(with: endPoint, interceptor: tokenInterceptor) } diff --git a/Poppool/Poppool/Domain/Entities/GetOtherUserCommentListResponse.swift b/Poppool/Poppool/Domain/Entities/GetOtherUserCommentListResponse.swift deleted file mode 100644 index 19fc1d57..00000000 --- a/Poppool/Poppool/Domain/Entities/GetOtherUserCommentListResponse.swift +++ /dev/null @@ -1,29 +0,0 @@ -// -// GetOtherUserCommentListResponse.swift -// Poppool -// -// Created by SeoJunYoung on 12/27/24. -// - -import Foundation - -struct GetOtherUserCommentListResponse { - var commentList: [GetOtherUserCommentResponse] - var totalPages: Int32 - var totalElements: Int64 -} - -struct GetOtherUserCommentResponse { - var commentId: Int64 - var content: String? - var likeCount: Int64 - var createDateTime: String? - var popUpStoreInfo: GetOtherUserCommentPopUpResponse -} - -struct GetOtherUserCommentPopUpResponse { - var popUpStoreId: Int64 - var popUpStoreName: String? - var mainImageUrl: String? - var closeYn: Bool -} diff --git a/Poppool/Poppool/Domain/Entities/GetOtherUserCommentedPopUpListResponse.swift b/Poppool/Poppool/Domain/Entities/GetOtherUserCommentedPopUpListResponse.swift new file mode 100644 index 00000000..98ec9461 --- /dev/null +++ b/Poppool/Poppool/Domain/Entities/GetOtherUserCommentedPopUpListResponse.swift @@ -0,0 +1,22 @@ +// +// GetOtherUserCommentedPopUpListResponse.swift +// Poppool +// +// Created by SeoJunYoung on 12/27/24. +// + +import Foundation + +struct GetOtherUserCommentedPopUpListResponse { + var popUpInfoList: [GetOtherUserCommentedPopUpResponse] +} + +struct GetOtherUserCommentedPopUpResponse { + var popUpStoreId: Int64 + var popUpStoreName: String? + var desc: String? + var startDate: String? + var endDate: String? + var address: String? + var closedYn: Bool +} diff --git a/Poppool/Poppool/Domain/UseCase/UserAPIUseCaseImpl.swift b/Poppool/Poppool/Domain/UseCase/UserAPIUseCaseImpl.swift index 63ad489d..2eab0c45 100644 --- a/Poppool/Poppool/Domain/UseCase/UserAPIUseCaseImpl.swift +++ b/Poppool/Poppool/Domain/UseCase/UserAPIUseCaseImpl.swift @@ -39,13 +39,13 @@ final class UserAPIUseCaseImpl { return repository.deleteUserBlock(request: .init(blockedUserId: blockedUserId)) } - func getOtherUserCommentList( + func getOtherUserCommentedPopUpList( commenterId: String?, commentType: String?, page: Int32?, size: Int32?, sort: String? - ) -> Observable { + ) -> Observable { return repository.getOtherUserCommentList( request: .init( commenterId: commenterId, diff --git a/Poppool/Poppool/Presentation/Scene/Comment/CommentList/CommentListReactor.swift b/Poppool/Poppool/Presentation/Scene/Comment/CommentList/CommentListReactor.swift index 20009e3a..769776ce 100644 --- a/Poppool/Poppool/Presentation/Scene/Comment/CommentList/CommentListReactor.swift +++ b/Poppool/Poppool/Presentation/Scene/Comment/CommentList/CommentListReactor.swift @@ -196,8 +196,12 @@ final class CommentListReactor: Reactor { controller.present(nextController, animated: true) case .presentCommentMenuScene(let controller, let row): let comment = commentSection.inputDataList[row] - // 분기 필요합니다~!~! - showOtherUserCommentMenu(controller: controller, comment: comment) + if comment.isMyComment { + showMyCommentMenu(controller: controller, comment: comment) + } else { + showOtherUserCommentMenu(controller: controller, comment: comment) + } + } return newState } diff --git a/Poppool/Poppool/Presentation/Scene/Comment/OtherUserComment/OtherUserCommentController.swift b/Poppool/Poppool/Presentation/Scene/Comment/OtherUserComment/OtherUserCommentController.swift index d2479e5a..2665a516 100644 --- a/Poppool/Poppool/Presentation/Scene/Comment/OtherUserComment/OtherUserCommentController.swift +++ b/Poppool/Poppool/Presentation/Scene/Comment/OtherUserComment/OtherUserCommentController.swift @@ -23,8 +23,6 @@ final class OtherUserCommentController: BaseViewController, View { private var sections: [any Sectionable] = [] - private let pageChange: PublishSubject = .init() - private let cellTapped: PublishSubject = .init() } @@ -46,6 +44,7 @@ extension OtherUserCommentController { private extension OtherUserCommentController { func setUp() { view.addSubview(mainView) + view.backgroundColor = .g50 mainView.snp.makeConstraints { make in make.edges.equalTo(view.safeAreaLayoutGuide) } @@ -65,8 +64,8 @@ private extension OtherUserCommentController { forCellWithReuseIdentifier: SpacingSectionCell.identifiers ) mainView.contentCollectionView.register( - OtherUserCommentSectionCell.self, - forCellWithReuseIdentifier: OtherUserCommentSectionCell.identifiers + MyCommentedPopUpGridSectionCell.self, + forCellWithReuseIdentifier: MyCommentedPopUpGridSectionCell.identifiers ) } } @@ -87,12 +86,6 @@ extension OtherUserCommentController { .bind(to: reactor.action) .disposed(by: disposeBag) - pageChange - .throttle(.milliseconds(1000), scheduler: MainScheduler.asyncInstance) - .map { Reactor.Action.changePage } - .bind(to: reactor.action) - .disposed(by: disposeBag) - cellTapped .withUnretained(self) .map { (owner, row) in @@ -129,15 +122,6 @@ extension OtherUserCommentController: UICollectionViewDelegate, UICollectionView return cell } - func scrollViewDidScroll(_ scrollView: UIScrollView) { - let contentHeight = scrollView.contentSize.height - let scrollViewHeight = scrollView.frame.size.height - let contentOffsetY = scrollView.contentOffset.y - if contentOffsetY + scrollViewHeight >= contentHeight { - pageChange.onNext(()) - } - } - func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { if indexPath.section == 3 { cellTapped.onNext(indexPath.row) } } diff --git a/Poppool/Poppool/Presentation/Scene/Comment/OtherUserComment/OtherUserCommentReactor.swift b/Poppool/Poppool/Presentation/Scene/Comment/OtherUserComment/OtherUserCommentReactor.swift index b9ce0d53..8394fea3 100644 --- a/Poppool/Poppool/Presentation/Scene/Comment/OtherUserComment/OtherUserCommentReactor.swift +++ b/Poppool/Poppool/Presentation/Scene/Comment/OtherUserComment/OtherUserCommentReactor.swift @@ -17,14 +17,12 @@ final class OtherUserCommentReactor: Reactor { enum Action { case viewWillAppear case backButtonTapped(controller: BaseViewController) - case changePage case cellTapped(controller: BaseViewController, row: Int) } enum Mutation { case moveToRecentScene(controller: BaseViewController) case loadView - case appendData case skip case moveToDetailScene(controller: BaseViewController, row: Int) } @@ -42,11 +40,6 @@ final class OtherUserCommentReactor: Reactor { private let commenterID: String? private let userAPIUseCase = UserAPIUseCaseImpl(repository: UserAPIRepositoryImpl(provider: ProviderImpl())) - private var isLoading: Bool = false - private var totalPage: Int32 = 0 - private var currentPage: Int32 = 0 - private var size: Int32 = 10 - lazy var compositionalLayout: UICollectionViewCompositionalLayout = { UICollectionViewCompositionalLayout { [weak self] section, env in guard let self = self else { @@ -62,7 +55,7 @@ final class OtherUserCommentReactor: Reactor { }() private let spacing16Section = SpacingSection(inputDataList: [.init(spacing: 16)]) private var countTitleSection = CommentListTitleSection(inputDataList: []) - private var popUpSection = OtherUserCommentSection(inputDataList: []) + private var popUpSection = MyCommentedPopUpGridSection(inputDataList: []) // MARK: - init init(commenterID: String?) { @@ -73,50 +66,22 @@ final class OtherUserCommentReactor: Reactor { // MARK: - Reactor Methods func mutate(action: Action) -> Observable { switch action { - case .changePage: - if isLoading { - return Observable.just(.skip) - } else { - if currentPage <= totalPage { - isLoading = true - currentPage += 1 - return userAPIUseCase.getOtherUserCommentList(commenterId: commenterID, commentType: "NORMAL", page: currentPage, size: size, sort: nil) - .withUnretained(self) - .map { (owner, response) in - owner.popUpSection.inputDataList.append(contentsOf: response.commentList.map { .init( - imagePath: $0.popUpStoreInfo.mainImageUrl, - likeCount: $0.likeCount, - title: $0.popUpStoreInfo.popUpStoreName, - comment: $0.content, - date: $0.createDateTime, - popUpID: $0.popUpStoreInfo.popUpStoreId - )}) - return .loadView - } - } else { - return Observable.just(.skip) - } - } case .viewWillAppear: - if popUpSection.isEmpty { - return userAPIUseCase.getOtherUserCommentList(commenterId: commenterID, commentType: "NORMAL", page: currentPage, size: size, sort: nil) - .withUnretained(self) - .map { (owner, response) in - owner.countTitleSection.inputDataList = [.init(count: Int(response.totalElements))] - owner.popUpSection.inputDataList = response.commentList.map { .init( - imagePath: $0.popUpStoreInfo.mainImageUrl, - likeCount: $0.likeCount, - title: $0.popUpStoreInfo.popUpStoreName, - comment: $0.content, - date: $0.createDateTime, - popUpID: $0.popUpStoreInfo.popUpStoreId - )} - owner.totalPage = response.totalPages - return .loadView - } - } else { - return Observable.just(.skip) - } + return userAPIUseCase.getOtherUserCommentedPopUpList(commenterId: commenterID, commentType: "NORMAL", page: 0, size: 100, sort: nil) + .withUnretained(self) + .map { (owner, responseList) in + owner.popUpSection.inputDataList = responseList.popUpInfoList.map({ response in + return .init( + popUpID: response.popUpStoreId, +// imageURL: response., + title: response.popUpStoreName, + content: response.desc, + startDate: response.startDate, + endDate: response.endDate + ) + }) + return .loadView + } case .backButtonTapped(let controller): return Observable.just(.moveToRecentScene(controller: controller)) case .cellTapped(let controller, let row): @@ -133,10 +98,6 @@ final class OtherUserCommentReactor: Reactor { case .loadView: newState.isReloadView = true newState.sections = getSection() - case .appendData: - newState.isReloadView = true - newState.sections = getSection() - isLoading = false case .skip: break case .moveToDetailScene(let controller, let row): diff --git a/Poppool/Poppool/Presentation/Scene/Comment/OtherUserComment/View/OtherUserCommentView.swift b/Poppool/Poppool/Presentation/Scene/Comment/OtherUserComment/View/OtherUserCommentView.swift index 10b6d2a1..e6d99298 100644 --- a/Poppool/Poppool/Presentation/Scene/Comment/OtherUserComment/View/OtherUserCommentView.swift +++ b/Poppool/Poppool/Presentation/Scene/Comment/OtherUserComment/View/OtherUserCommentView.swift @@ -20,6 +20,7 @@ final class OtherUserCommentView: UIView { let contentCollectionView: UICollectionView = { let view = UICollectionView(frame: .zero, collectionViewLayout: .init()) + view.backgroundColor = .g50 return view }() From 6b6de27f6c8b180fc5f93c2762ce11626f18b8eb Mon Sep 17 00:00:00 2001 From: JunYoung Date: Sun, 9 Feb 2025 22:02:42 +0900 Subject: [PATCH 2/3] =?UTF-8?q?[FIX]:=20Image=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GetOtherUserCommentedPopUpListResponseDTO.swift | 4 +++- .../Entities/GetOtherUserCommentedPopUpListResponse.swift | 1 + .../Comment/OtherUserComment/OtherUserCommentReactor.swift | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Poppool/Poppool/Data/Network/UserAPI/ResponseDTO/GetOtherUserCommentedPopUpListResponseDTO.swift b/Poppool/Poppool/Data/Network/UserAPI/ResponseDTO/GetOtherUserCommentedPopUpListResponseDTO.swift index 7bafcdad..45948742 100644 --- a/Poppool/Poppool/Data/Network/UserAPI/ResponseDTO/GetOtherUserCommentedPopUpListResponseDTO.swift +++ b/Poppool/Poppool/Data/Network/UserAPI/ResponseDTO/GetOtherUserCommentedPopUpListResponseDTO.swift @@ -21,6 +21,7 @@ struct GetOtherUserCommentedPopUpResponseDTO: Decodable { var popUpStoreId: Int64 var popUpStoreName: String? var desc: String? + var mainImageUrl: String? var startDate: String? var endDate: String? var address: String? @@ -32,7 +33,8 @@ extension GetOtherUserCommentedPopUpResponseDTO { return .init( popUpStoreId: popUpStoreId, popUpStoreName: popUpStoreName, - desc: desc, + desc: desc, + mainImageUrl: mainImageUrl, startDate: startDate.toDate().toPPDateString(), endDate: endDate.toDate().toPPDateString(), address: address, diff --git a/Poppool/Poppool/Domain/Entities/GetOtherUserCommentedPopUpListResponse.swift b/Poppool/Poppool/Domain/Entities/GetOtherUserCommentedPopUpListResponse.swift index 98ec9461..71fce6de 100644 --- a/Poppool/Poppool/Domain/Entities/GetOtherUserCommentedPopUpListResponse.swift +++ b/Poppool/Poppool/Domain/Entities/GetOtherUserCommentedPopUpListResponse.swift @@ -15,6 +15,7 @@ struct GetOtherUserCommentedPopUpResponse { var popUpStoreId: Int64 var popUpStoreName: String? var desc: String? + var mainImageUrl: String? var startDate: String? var endDate: String? var address: String? diff --git a/Poppool/Poppool/Presentation/Scene/Comment/OtherUserComment/OtherUserCommentReactor.swift b/Poppool/Poppool/Presentation/Scene/Comment/OtherUserComment/OtherUserCommentReactor.swift index 8394fea3..af4281b6 100644 --- a/Poppool/Poppool/Presentation/Scene/Comment/OtherUserComment/OtherUserCommentReactor.swift +++ b/Poppool/Poppool/Presentation/Scene/Comment/OtherUserComment/OtherUserCommentReactor.swift @@ -73,7 +73,7 @@ final class OtherUserCommentReactor: Reactor { owner.popUpSection.inputDataList = responseList.popUpInfoList.map({ response in return .init( popUpID: response.popUpStoreId, -// imageURL: response., + imageURL: response.mainImageUrl, title: response.popUpStoreName, content: response.desc, startDate: response.startDate, From 5d5e0d4c71058d37c4d7a0360282f968fe5c940a Mon Sep 17 00:00:00 2001 From: JunYoung Date: Sun, 9 Feb 2025 22:03:57 +0900 Subject: [PATCH 3/3] [DEPLOY]: 1.0.4 TF --- Poppool/Poppool.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Poppool/Poppool.xcodeproj/project.pbxproj b/Poppool/Poppool.xcodeproj/project.pbxproj index 78a56794..7f909849 100644 --- a/Poppool/Poppool.xcodeproj/project.pbxproj +++ b/Poppool/Poppool.xcodeproj/project.pbxproj @@ -3842,7 +3842,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.3; + MARKETING_VERSION = 1.0.4; PRODUCT_BUNDLE_IDENTIFIER = com.poppoolIOS.poppool; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; @@ -3880,7 +3880,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.3; + MARKETING_VERSION = 1.0.4; PRODUCT_BUNDLE_IDENTIFIER = com.poppoolIOS.poppool; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";