diff --git a/AVIRO.xcodeproj/project.pbxproj b/AVIRO.xcodeproj/project.pbxproj index 1064a1bc..a4a87b7d 100644 --- a/AVIRO.xcodeproj/project.pbxproj +++ b/AVIRO.xcodeproj/project.pbxproj @@ -95,6 +95,7 @@ C52FA3472A175B20005E70DC /* HomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C52FA3462A175B20005E70DC /* HomeViewController.swift */; }; C52FA34C2A175B20005E70DC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C52FA34B2A175B20005E70DC /* Assets.xcassets */; }; C52FA34F2A175B20005E70DC /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C52FA34D2A175B20005E70DC /* LaunchScreen.storyboard */; }; + C533122A2C7CA2C70026703B /* WelcomePopups.swift in Sources */ = {isa = PBXBuildFile; fileRef = C53312292C7CA2C70026703B /* WelcomePopups.swift */; }; C534B14E2C2EABE900C62FDA /* LoginInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = C534B14D2C2EABE900C62FDA /* LoginInfo.swift */; }; C534B1522C32662A00C62FDA /* LoginButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = C534B1512C32662A00C62FDA /* LoginButton.swift */; }; C5351B4D2A19223300116D50 /* KakaoMapRequestAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5351B4C2A19223300116D50 /* KakaoMapRequestAPI.swift */; }; @@ -142,7 +143,7 @@ C562B6DF2B387AE200CE5D4C /* ChallengeInfoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C562B6DE2B387AE200CE5D4C /* ChallengeInfoViewController.swift */; }; C562B6E22B387B8700CE5D4C /* ChallengeInfoPresentationAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C562B6E12B387B8700CE5D4C /* ChallengeInfoPresentationAnimator.swift */; }; C562B6E42B387CA200CE5D4C /* ChallengeInfoPresentaionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C562B6E32B387CA200CE5D4C /* ChallengeInfoPresentaionDelegate.swift */; }; - C564DAB32BA57240002174B4 /* AVIROWellcome+DTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = C564DAB22BA57240002174B4 /* AVIROWellcome+DTO.swift */; }; + C564DAB32BA57240002174B4 /* AVIROWelcome+DTO.swift in Sources */ = {isa = PBXBuildFile; fileRef = C564DAB22BA57240002174B4 /* AVIROWelcome+DTO.swift */; }; C566EF622C398EC6009E58DD /* AuthAPIEndpoints.swift in Sources */ = {isa = PBXBuildFile; fileRef = C566EF612C398EC6009E58DD /* AuthAPIEndpoints.swift */; }; C566EF652C39931B009E58DD /* RepositoryTask.swift in Sources */ = {isa = PBXBuildFile; fileRef = C566EF642C39931B009E58DD /* RepositoryTask.swift */; }; C566EF672C399333009E58DD /* Cancellable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C566EF662C399333009E58DD /* Cancellable.swift */; }; @@ -437,6 +438,7 @@ C52FA3462A175B20005E70DC /* HomeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeViewController.swift; sourceTree = ""; }; C52FA34B2A175B20005E70DC /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; C52FA3502A175B20005E70DC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + C53312292C7CA2C70026703B /* WelcomePopups.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomePopups.swift; sourceTree = ""; }; C534B14D2C2EABE900C62FDA /* LoginInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginInfo.swift; sourceTree = ""; }; C534B1512C32662A00C62FDA /* LoginButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginButton.swift; sourceTree = ""; }; C5351B4A2A1919F700116D50 /* .swiftlint.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .swiftlint.yml; sourceTree = ""; }; @@ -487,7 +489,7 @@ C562B6DE2B387AE200CE5D4C /* ChallengeInfoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChallengeInfoViewController.swift; sourceTree = ""; }; C562B6E12B387B8700CE5D4C /* ChallengeInfoPresentationAnimator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChallengeInfoPresentationAnimator.swift; sourceTree = ""; }; C562B6E32B387CA200CE5D4C /* ChallengeInfoPresentaionDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChallengeInfoPresentaionDelegate.swift; sourceTree = ""; }; - C564DAB22BA57240002174B4 /* AVIROWellcome+DTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AVIROWellcome+DTO.swift"; sourceTree = ""; }; + C564DAB22BA57240002174B4 /* AVIROWelcome+DTO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AVIROWelcome+DTO.swift"; sourceTree = ""; }; C566EF612C398EC6009E58DD /* AuthAPIEndpoints.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthAPIEndpoints.swift; sourceTree = ""; }; C566EF642C39931B009E58DD /* RepositoryTask.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RepositoryTask.swift; sourceTree = ""; }; C566EF662C399333009E58DD /* Cancellable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Cancellable.swift; sourceTree = ""; }; @@ -760,9 +762,10 @@ path = Manager; sourceTree = ""; }; - C50367F32A1795BE0020C6BB /* Model */ = { + C50367F32A1795BE0020C6BB /* Model_Domain */ = { isa = PBXGroup; children = ( + C53312282C7CA2B40026703B /* WelcomeModel */, C51000292AB5B90200F65C1F /* UserModel */, C5EB51022A20927400B29CC1 /* HomeViewModel */, C5732C7A2A41D3F800CDC499 /* EnrollViewModel */, @@ -772,7 +775,7 @@ C51B09B62A82046000916BBD /* LocalDataModel */, C5351B652A1A128D00116D50 /* SingletonModel */, ); - path = Model; + path = Model_Domain; sourceTree = ""; }; C50367F62A179D6E0020C6BB /* Custom */ = { @@ -986,13 +989,6 @@ path = HeaderView; sourceTree = ""; }; - C520663D2A80C60D0038ECCD /* ViewLogic */ = { - isa = PBXGroup; - children = ( - ); - path = ViewLogic; - sourceTree = ""; - }; C520663E2A80C6220038ECCD /* CoordinateSingleton */ = { isa = PBXGroup; children = ( @@ -1047,7 +1043,7 @@ C593B64C2A4BFD9A00D224CE /* AVIRO.entitlements */, C50367EC2A1791620020C6BB /* App */, C50367F62A179D6E0020C6BB /* Custom */, - C50367F32A1795BE0020C6BB /* Model */, + C50367F32A1795BE0020C6BB /* Model_Domain */, C50367F22A1795B90020C6BB /* Manager */, C50367ED2A1791840020C6BB /* Scene */, C5BA9DFE2BED1C64004FA06E /* Data */, @@ -1059,6 +1055,14 @@ path = AVIRO; sourceTree = ""; }; + C53312282C7CA2B40026703B /* WelcomeModel */ = { + isa = PBXGroup; + children = ( + C53312292C7CA2C70026703B /* WelcomePopups.swift */, + ); + path = WelcomeModel; + sourceTree = ""; + }; C534B14C2C2EABD300C62FDA /* User */ = { isa = PBXGroup; children = ( @@ -1080,7 +1084,6 @@ C5351B652A1A128D00116D50 /* SingletonModel */ = { isa = PBXGroup; children = ( - C520663D2A80C60D0038ECCD /* ViewLogic */, C5166E4B2A945214003495AA /* MyData */, C520663E2A80C6220038ECCD /* CoordinateSingleton */, C520663F2A80C6450038ECCD /* APISingleton */, @@ -1536,7 +1539,7 @@ C564DAB12BA571A7002174B4 /* ETC */ = { isa = PBXGroup; children = ( - C564DAB22BA57240002174B4 /* AVIROWellcome+DTO.swift */, + C564DAB22BA57240002174B4 /* AVIROWelcome+DTO.swift */, ); path = ETC; sourceTree = ""; @@ -3061,7 +3064,7 @@ C5A201C72A98A6D200A54381 /* EditOperatingHoursView.swift in Sources */, C5BA9DF62BECCD58004FA06E /* DataTransferError.swift in Sources */, C5C290772A85E4FF00ED5DCE /* PlaceHomeView.swift in Sources */, - C564DAB32BA57240002174B4 /* AVIROWellcome+DTO.swift in Sources */, + C564DAB32BA57240002174B4 /* AVIROWelcome+DTO.swift in Sources */, C5D93D9F2A581EC800629C39 /* FirstRegistrationViewController.swift in Sources */, C528E4C02A5FF1CB002BD72E /* FinalRegistrationViewController.swift in Sources */, C5FBDA5C2B398264007AC77E /* ChallengeInfoYellowView.swift in Sources */, @@ -3069,6 +3072,7 @@ C5A1691D2C4D5DD60028BCC0 /* CommonError.swift in Sources */, C5D93DA32A58718300629C39 /* NextPageButton.swift in Sources */, C5ED99602C088FAA0077B2F9 /* UserInfoRepositoryInterface.swift in Sources */, + C533122A2C7CA2C70026703B /* WelcomePopups.swift in Sources */, C5BA9E0E2BED1D75004FA06E /* AVIROViewModel.swift in Sources */, C50DB7512A9B83550078B501 /* ChangeableAddressViewController.swift in Sources */, C5ED99762C0892170077B2F9 /* StoreManagementRepositoryInterface.swift in Sources */, @@ -3435,7 +3439,7 @@ CODE_SIGN_ENTITLEMENTS = AVIRO/AVIRO.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = C4K2HXA435; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = AVIRO/App/Info.plist; @@ -3454,7 +3458,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.3.1; + MARKETING_VERSION = 1.4.0; PRODUCT_BUNDLE_IDENTIFIER = SeonghunJeon.VeganRestaurant; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -3473,7 +3477,7 @@ CODE_SIGN_ENTITLEMENTS = AVIRO/AVIRO.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = C4K2HXA435; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = AVIRO/App/Info.plist; @@ -3492,7 +3496,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.3.1; + MARKETING_VERSION = 1.4.0; PRODUCT_BUNDLE_IDENTIFIER = SeonghunJeon.VeganRestaurant; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/AVIRO/App/AppController.swift b/AVIRO/App/AppController.swift index 4786b0a6..fa90d33a 100644 --- a/AVIRO/App/AppController.swift +++ b/AVIRO/App/AppController.swift @@ -42,6 +42,7 @@ final class AppController { self.window = window window.backgroundColor = .gray7 +// setTutorialView() // setTabBarView() checkLoginType() } @@ -133,13 +134,12 @@ final class AppController { keychain.delete(KeychainKey.refreshToken.rawValue) guard let userID = keychain.get(KeychainKey.userID.rawValue) else { - print("ADAWDAW") setLoginView() return } let userCheck = AVIROKakaoUserCheckMemberDTO(userId: userID) - print("TSET") + AVIROAPI.manager.checkKakaoUserWhenLogin(with: userCheck) { [weak self] result in DispatchQueue.main.async { switch result { diff --git a/AVIRO/Custom/Utility/AmplitudeUtility.swift b/AVIRO/Custom/Utility/AmplitudeUtility.swift index 308e83f9..dce8f82a 100644 --- a/AVIRO/Custom/Utility/AmplitudeUtility.swift +++ b/AVIRO/Custom/Utility/AmplitudeUtility.swift @@ -11,19 +11,29 @@ import AmplitudeSwift // MARK: Amplitude enum AMType: String { + // Remove case signUp = "user_sign up" + // Remove case withdrawal = "user_withdrawal" + // Remove case userLogin = "user_login" + // Remove case userLogout = "user_logout" - + //t + // Move case placeUpload = "place_upload" + // Move case reviewUpload = "review_upload" - + // Move case placeEdit = "place_edit" + // Remove case placeSearch = "place_serach" + // Remove case placePresent = "place_present" + // Move case menuEdit = "menu_edit" + // Move everything case challPresent = "chall_present" case placeListPresent = "placeList_present" case reviewListPresent = "reviewList_present" @@ -36,6 +46,41 @@ enum AMType: String { case wellcomeClose = "wellcome_close" } +enum AMPUserType: String { + case signUpClick = "signup_click" + case signupComplete = "signup_complete" + case loginComplete = "login_complete" + case logoutComplete = "logout_comlete" + case withdrawalComplete = "withdrawal_Complete" +} + +enum AMPBrowseType: String { + case searchEnterTerm = "search_enter_term" + case searchClickResult = "search_click_result" + case bookmarkClickInPlace = "bookmark_click_in_place" + case bookmarkClickInMap = "bookmark_click_in_map" + case bookmarkClickList = "bookmark_click_list" + case placeViewSheet = "place_view_sheet" + case placeViewhalf = "place_view_half" + case placeViewMenu = "place_view_menu" + case placeViewReview = "place_view_review" +} + +enum AMPEngage: String { + case reviewViewUpload = "review_view_upload" + case reviewCompleteUpload = "review_complete_upload" + case placeViewUpload = "place_view_upload" + case placeCompleteUpload = "place_complete_upload" + case challengeClickCheckingLevelUp = "challenge_click_checking_levelup" + case challengeView = "challenge_view" + case placeClickEditPlace = "place_click_edit_place" + case placeCompleteEditPlace = "place_complete_edit_place" + case placeClickEditMenu = "place_click_edit_menu" + case placeCompleteEditMenu = "place_complete_edit_menu" + case placeClickRemove = "place_click_remove" + case placeCompleteRemove = "place_complete_remove" +} + protocol AmplitudeProtocol { func signUp(with userId: String) func withdrawal() diff --git a/AVIRO/Manager/APIManager/AVIROManager/AVIROAPI.swift b/AVIRO/Manager/APIManager/AVIROManager/AVIROAPI.swift index 49c9d825..5a9f90cc 100644 --- a/AVIRO/Manager/APIManager/AVIROManager/AVIROAPI.swift +++ b/AVIRO/Manager/APIManager/AVIROManager/AVIROAPI.swift @@ -922,10 +922,10 @@ final class AVIROAPI: AVIROAPIMangerProtocol { */ // MARK: Get wellcomeImagesURL - func loadWellcomeImagesURL( - completionHandler: @escaping (Result) -> Void + func loadWelcomePopups( + completionHandler: @escaping (Result) -> Void ) { - guard let url = requestAPI.getWellcomImagesURL().url else { + guard let url = requestAPI.getWelcomeImagesURL().url else { completionHandler(.failure(.urlError)) return } diff --git a/AVIRO/Manager/APIManager/AVIROManager/AVIROAPIManagerProtocol.swift b/AVIRO/Manager/APIManager/AVIROManager/AVIROAPIManagerProtocol.swift index 0ad211d4..c9dfc901 100644 --- a/AVIRO/Manager/APIManager/AVIROManager/AVIROAPIManagerProtocol.swift +++ b/AVIRO/Manager/APIManager/AVIROManager/AVIROAPIManagerProtocol.swift @@ -8,7 +8,7 @@ import Foundation protocol AVIROAPIMangerProtocol: APIManagerProtocol { - // MARK: - Marker Refer + // MARK: - Marker / Map Refer /* - GET places - POST place @@ -272,4 +272,9 @@ protocol AVIROAPIMangerProtocol: APIManagerProtocol { with nickname: AVIRONicknameChagneableDTO, completionHandler: @escaping (Result) -> Void ) + + // MARK: Popup + func loadWelcomePopups( + completionHandler: @escaping (Result) -> Void + ) } diff --git a/AVIRO/Manager/APIManager/AVIROManager/AVIRORequestAPI.swift b/AVIRO/Manager/APIManager/AVIROManager/AVIRORequestAPI.swift index 71b392f8..44884a8c 100644 --- a/AVIRO/Manager/APIManager/AVIROManager/AVIRORequestAPI.swift +++ b/AVIRO/Manager/APIManager/AVIROManager/AVIRORequestAPI.swift @@ -54,7 +54,7 @@ struct AVIRORequestAPI { static let myCommentListPath = "/2/mypage/comment" static let myBookmarkListPath = "/2/mypage/bookmark" - static let wellcomeImagesPath = "/2/map/load/popup" + static let welcomeImagesPath = "/3/map/load/popup" static let kakaoUserCheckPath = "/3/member/kakao" @@ -304,8 +304,8 @@ struct AVIRORequestAPI { } // MARK: GET WellcomeImages URL - mutating func getWellcomImagesURL() -> URLComponents { - return createURLComponents(path: AVIRORequestAPI.wellcomeImagesPath) + mutating func getWelcomeImagesURL() -> URLComponents { + return createURLComponents(path: AVIRORequestAPI.welcomeImagesPath) } // MARK: Kakao user check diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/ETC/AVIROWellcome+DTO.swift b/AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/ETC/AVIROWellcome+DTO.swift deleted file mode 100644 index 2ad816f8..00000000 --- a/AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/ETC/AVIROWellcome+DTO.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// AVIROWellcome+DTO.swift -// AVIRO -// -// Created by 전성훈 on 2024/03/16. -// - -import Foundation - -struct AVIROWellcomeDTO: Decodable { - let statusCode: Int - let data: AVIROWellcomeDataDTO? - let message: String? -} - -struct AVIROWellcomeDataDTO: Decodable { - let imageUrl: String -} diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/Challenge/AVIROChallengeCommentDTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/Challenge/AVIROChallengeCommentDTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/Challenge/AVIROChallengeCommentDTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/Challenge/AVIROChallengeCommentDTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/Challenge/AVIROChallengeInfoResult+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/Challenge/AVIROChallengeInfoResult+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/Challenge/AVIROChallengeInfoResult+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/Challenge/AVIROChallengeInfoResult+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/Challenge/AVIROMyChallengeLevelResult+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/Challenge/AVIROMyChallengeLevelResult+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/Challenge/AVIROMyChallengeLevelResult+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/Challenge/AVIROMyChallengeLevelResult+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/Challenge/AVIROMyContributionCount+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/Challenge/AVIROMyContributionCount+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/Challenge/AVIROMyContributionCount+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/Challenge/AVIROMyContributionCount+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/CheckPlace/AVIROCheckPlace+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/CheckPlace/AVIROCheckPlace+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/CheckPlace/AVIROCheckPlace+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/CheckPlace/AVIROCheckPlace+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/CheckPlace/AVIROPlaceReportCheck+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/CheckPlace/AVIROPlaceReportCheck+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/CheckPlace/AVIROPlaceReportCheck+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/CheckPlace/AVIROPlaceReportCheck+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/DetailPlace/AVIROOperationHours+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/DetailPlace/AVIROOperationHours+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/DetailPlace/AVIROOperationHours+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/DetailPlace/AVIROOperationHours+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/DetailPlace/AVIROPlaceInfo+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/DetailPlace/AVIROPlaceInfo+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/DetailPlace/AVIROPlaceInfo+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/DetailPlace/AVIROPlaceInfo+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/DetailPlace/AVIROPlaceMenus+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/DetailPlace/AVIROPlaceMenus+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/DetailPlace/AVIROPlaceMenus+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/DetailPlace/AVIROPlaceMenus+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/DetailPlace/AVIROPlaceReviews+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/DetailPlace/AVIROPlaceReviews+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/DetailPlace/AVIROPlaceReviews+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/DetailPlace/AVIROPlaceReviews+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/DetailPlace/AVIROPlaceSummary+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/DetailPlace/AVIROPlaceSummary+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/DetailPlace/AVIROPlaceSummary+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/DetailPlace/AVIROPlaceSummary+DTO.swift diff --git a/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/ETC/AVIROWelcome+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/ETC/AVIROWelcome+DTO.swift new file mode 100644 index 00000000..b2ffe640 --- /dev/null +++ b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/ETC/AVIROWelcome+DTO.swift @@ -0,0 +1,57 @@ +// +// AVIROWelcome+DTO.swift +// AVIRO +// +// Created by 전성훈 on 2024/03/16. +// + +import Foundation + +struct AVIROWelcomeDTO: Decodable { + let statusCode: Int + let data: [AVIROWelcomeDataDTO]? + let message: String? +} + +struct AVIROWelcomeDataDTO: Decodable { + let title: String + let imageURL: String + let url: String? + let event: String? + let buttonColor: String + let order: Int + + enum CodingKeys: String, CodingKey { + case title + case imageURL = "image_url" + case url + case event + case buttonColor = "button_color" + case order + } + + func toDomain() -> WelcomePopup { + let imageURL = URL(string: imageURL)! + + let url = self.url.flatMap { URL(string: $0) } + + let event: WelcomePopupEvent? = { + guard let eventString = self.event else { return nil } + + switch eventString { + case "MTCH": + return .MTCH + default: + return nil + } + }() + + return WelcomePopup( + title: title, + imageURL: imageURL, + url: url, + event: event, + buttonColor: buttonColor + ) + } +} diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/Marker/AVIROBookmark+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/Marker/AVIROBookmark+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/Marker/AVIROBookmark+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/Marker/AVIROBookmark+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/Marker/AVIROMapMarker+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/Marker/AVIROMapMarker+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/Marker/AVIROMapMarker+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/Marker/AVIROMapMarker+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/MyPage/AVIROMyBookmarkList+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/MyPage/AVIROMyBookmarkList+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/MyPage/AVIROMyBookmarkList+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/MyPage/AVIROMyBookmarkList+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/MyPage/AVIROMyCommentList+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/MyPage/AVIROMyCommentList+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/MyPage/AVIROMyCommentList+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/MyPage/AVIROMyCommentList+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/MyPage/AVIROMyPlaceList+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/MyPage/AVIROMyPlaceList+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROGet/MyPage/AVIROMyPlaceList+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROGet/MyPage/AVIROMyPlaceList+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/AVIROResult+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/AVIROResult+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/AVIROResult+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/AVIROResult+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/Compare/AVIROMainSearchCompare+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/Compare/AVIROMainSearchCompare+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/Compare/AVIROMainSearchCompare+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/Compare/AVIROMainSearchCompare+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/Edit/AVIROEditCommonBeforeAfterDTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/Edit/AVIROEditCommonBeforeAfterDTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/Edit/AVIROEditCommonBeforeAfterDTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/Edit/AVIROEditCommonBeforeAfterDTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/Edit/AVIROEditLocation+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/Edit/AVIROEditLocation+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/Edit/AVIROEditLocation+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/Edit/AVIROEditLocation+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/Edit/AVIROEditMenuModel+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/Edit/AVIROEditMenuModel+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/Edit/AVIROEditMenuModel+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/Edit/AVIROEditMenuModel+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/Edit/AVIROEditOperationTime+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/Edit/AVIROEditOperationTime+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/Edit/AVIROEditOperationTime+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/Edit/AVIROEditOperationTime+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/Edit/AVIROEditPhone+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/Edit/AVIROEditPhone+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/Edit/AVIROEditPhone+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/Edit/AVIROEditPhone+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/Edit/AVIROEditURL+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/Edit/AVIROEditURL+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/Edit/AVIROEditURL+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/Edit/AVIROEditURL+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/Enroll/AVIROEnrollPlace+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/Enroll/AVIROEnrollPlace+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/Enroll/AVIROEnrollPlace+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/Enroll/AVIROEnrollPlace+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/Enroll/AVIROReview+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/Enroll/AVIROReview+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/Enroll/AVIROReview+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/Enroll/AVIROReview+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/Report/AVIROReportPlace+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/Report/AVIROReportPlace+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/Report/AVIROReportPlace+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/Report/AVIROReportPlace+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/Report/AVIROReportReview+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/Report/AVIROReportReview+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/Report/AVIROReportReview+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/Report/AVIROReportReview+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/Update/AVIROUpdateBookmark+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/Update/AVIROUpdateBookmark+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/Update/AVIROUpdateBookmark+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/Update/AVIROUpdateBookmark+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/User/AVIROUser+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/User/AVIROUser+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/AVIRO/AVIROPost/User/AVIROUser+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/AVIRO/AVIROPost/User/AVIROUser+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/KakaoMap/KakaoAddressPlace+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/KakaoMap/KakaoAddressPlace+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/KakaoMap/KakaoAddressPlace+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/KakaoMap/KakaoAddressPlace+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/KakaoMap/KakaoCoordinateSearchDTO.swift b/AVIRO/Model_Domain/APIResonseModel/KakaoMap/KakaoCoordinateSearchDTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/KakaoMap/KakaoCoordinateSearchDTO.swift rename to AVIRO/Model_Domain/APIResonseModel/KakaoMap/KakaoCoordinateSearchDTO.swift diff --git a/AVIRO/Model/APIResonseModel/KakaoMap/KakaoKeywordPlace+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/KakaoMap/KakaoKeywordPlace+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/KakaoMap/KakaoKeywordPlace+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/KakaoMap/KakaoKeywordPlace+DTO.swift diff --git a/AVIRO/Model/APIResonseModel/KakaoMap/KakaoKeywordResultDTO.swift b/AVIRO/Model_Domain/APIResonseModel/KakaoMap/KakaoKeywordResultDTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/KakaoMap/KakaoKeywordResultDTO.swift rename to AVIRO/Model_Domain/APIResonseModel/KakaoMap/KakaoKeywordResultDTO.swift diff --git a/AVIRO/Model/APIResonseModel/Public/PublicAddress+DTO.swift b/AVIRO/Model_Domain/APIResonseModel/Public/PublicAddress+DTO.swift similarity index 100% rename from AVIRO/Model/APIResonseModel/Public/PublicAddress+DTO.swift rename to AVIRO/Model_Domain/APIResonseModel/Public/PublicAddress+DTO.swift diff --git a/AVIRO/Model/EnrollViewModel/MenuModel.swift b/AVIRO/Model_Domain/EnrollViewModel/MenuModel.swift similarity index 100% rename from AVIRO/Model/EnrollViewModel/MenuModel.swift rename to AVIRO/Model_Domain/EnrollViewModel/MenuModel.swift diff --git a/AVIRO/Model/EnrollViewModel/RequestTableFieldModel.swift b/AVIRO/Model_Domain/EnrollViewModel/RequestTableFieldModel.swift similarity index 100% rename from AVIRO/Model/EnrollViewModel/RequestTableFieldModel.swift rename to AVIRO/Model_Domain/EnrollViewModel/RequestTableFieldModel.swift diff --git a/AVIRO/Model/EnrollViewModel/VeganTableFieldModel.swift b/AVIRO/Model_Domain/EnrollViewModel/VeganTableFieldModel.swift similarity index 100% rename from AVIRO/Model/EnrollViewModel/VeganTableFieldModel.swift rename to AVIRO/Model_Domain/EnrollViewModel/VeganTableFieldModel.swift diff --git a/AVIRO/Model/HomeViewModel/EditModel/EditMenuChangedMarkerModel.swift b/AVIRO/Model_Domain/HomeViewModel/EditModel/EditMenuChangedMarkerModel.swift similarity index 100% rename from AVIRO/Model/HomeViewModel/EditModel/EditMenuChangedMarkerModel.swift rename to AVIRO/Model_Domain/HomeViewModel/EditModel/EditMenuChangedMarkerModel.swift diff --git a/AVIRO/Model/HomeViewModel/EditModel/EditOperationHoursModel.swift b/AVIRO/Model_Domain/HomeViewModel/EditModel/EditOperationHoursModel.swift similarity index 100% rename from AVIRO/Model/HomeViewModel/EditModel/EditOperationHoursModel.swift rename to AVIRO/Model_Domain/HomeViewModel/EditModel/EditOperationHoursModel.swift diff --git a/AVIRO/Model/HomeViewModel/HomeSearchViewModel/HistoryTableModel.swift b/AVIRO/Model_Domain/HomeViewModel/HomeSearchViewModel/HistoryTableModel.swift similarity index 100% rename from AVIRO/Model/HomeViewModel/HomeSearchViewModel/HistoryTableModel.swift rename to AVIRO/Model_Domain/HomeViewModel/HomeSearchViewModel/HistoryTableModel.swift diff --git a/AVIRO/Model/HomeViewModel/HomeSearchViewModel/MatchedPlaceCellModel.swift b/AVIRO/Model_Domain/HomeViewModel/HomeSearchViewModel/MatchedPlaceCellModel.swift similarity index 100% rename from AVIRO/Model/HomeViewModel/HomeSearchViewModel/MatchedPlaceCellModel.swift rename to AVIRO/Model_Domain/HomeViewModel/HomeSearchViewModel/MatchedPlaceCellModel.swift diff --git a/AVIRO/Model/HomeViewModel/HomeSearchViewModel/MatchedPlaceModel.swift b/AVIRO/Model_Domain/HomeViewModel/HomeSearchViewModel/MatchedPlaceModel.swift similarity index 100% rename from AVIRO/Model/HomeViewModel/HomeSearchViewModel/MatchedPlaceModel.swift rename to AVIRO/Model_Domain/HomeViewModel/HomeSearchViewModel/MatchedPlaceModel.swift diff --git a/AVIRO/Model/HomeViewModel/MarkerModel.swift b/AVIRO/Model_Domain/HomeViewModel/MarkerModel.swift similarity index 100% rename from AVIRO/Model/HomeViewModel/MarkerModel.swift rename to AVIRO/Model_Domain/HomeViewModel/MarkerModel.swift diff --git a/AVIRO/Model/HomeViewModel/PlaceViewModel/PlaceTopModel.swift b/AVIRO/Model_Domain/HomeViewModel/PlaceViewModel/PlaceTopModel.swift similarity index 100% rename from AVIRO/Model/HomeViewModel/PlaceViewModel/PlaceTopModel.swift rename to AVIRO/Model_Domain/HomeViewModel/PlaceViewModel/PlaceTopModel.swift diff --git a/AVIRO/Model/HomeViewModel/ReportModel/ReportReviewModel.swift b/AVIRO/Model_Domain/HomeViewModel/ReportModel/ReportReviewModel.swift similarity index 100% rename from AVIRO/Model/HomeViewModel/ReportModel/ReportReviewModel.swift rename to AVIRO/Model_Domain/HomeViewModel/ReportModel/ReportReviewModel.swift diff --git a/AVIRO/Model/LocalDataModel/BookmarkCache.swift b/AVIRO/Model_Domain/LocalDataModel/BookmarkCache.swift similarity index 100% rename from AVIRO/Model/LocalDataModel/BookmarkCache.swift rename to AVIRO/Model_Domain/LocalDataModel/BookmarkCache.swift diff --git a/AVIRO/Model/LocalDataModel/MarkerModelCache.swift b/AVIRO/Model_Domain/LocalDataModel/MarkerModelCache.swift similarity index 100% rename from AVIRO/Model/LocalDataModel/MarkerModelCache.swift rename to AVIRO/Model_Domain/LocalDataModel/MarkerModelCache.swift diff --git a/AVIRO/Model/LocalDataModel/MarkerModelLocalDB.swift b/AVIRO/Model_Domain/LocalDataModel/MarkerModelLocalDB.swift similarity index 100% rename from AVIRO/Model/LocalDataModel/MarkerModelLocalDB.swift rename to AVIRO/Model_Domain/LocalDataModel/MarkerModelLocalDB.swift diff --git a/AVIRO/Model/MyPageModel/MyDataModel.swift b/AVIRO/Model_Domain/MyPageModel/MyDataModel.swift similarity index 100% rename from AVIRO/Model/MyPageModel/MyDataModel.swift rename to AVIRO/Model_Domain/MyPageModel/MyDataModel.swift diff --git a/AVIRO/Model/PlaceListModel/PlaceListCellModel.swift b/AVIRO/Model_Domain/PlaceListModel/PlaceListCellModel.swift similarity index 100% rename from AVIRO/Model/PlaceListModel/PlaceListCellModel.swift rename to AVIRO/Model_Domain/PlaceListModel/PlaceListCellModel.swift diff --git a/AVIRO/Model/PlaceListModel/PlaceListModel.swift b/AVIRO/Model_Domain/PlaceListModel/PlaceListModel.swift similarity index 100% rename from AVIRO/Model/PlaceListModel/PlaceListModel.swift rename to AVIRO/Model_Domain/PlaceListModel/PlaceListModel.swift diff --git a/AVIRO/Model/SingletonModel/APISingleton/KakaoAPISortingQuery.swift b/AVIRO/Model_Domain/SingletonModel/APISingleton/KakaoAPISortingQuery.swift similarity index 100% rename from AVIRO/Model/SingletonModel/APISingleton/KakaoAPISortingQuery.swift rename to AVIRO/Model_Domain/SingletonModel/APISingleton/KakaoAPISortingQuery.swift diff --git a/AVIRO/Model/SingletonModel/CoordinateSingleton/CenterCoordinate.swift b/AVIRO/Model_Domain/SingletonModel/CoordinateSingleton/CenterCoordinate.swift similarity index 100% rename from AVIRO/Model/SingletonModel/CoordinateSingleton/CenterCoordinate.swift rename to AVIRO/Model_Domain/SingletonModel/CoordinateSingleton/CenterCoordinate.swift diff --git a/AVIRO/Model/SingletonModel/CoordinateSingleton/UserCoordinate.swift b/AVIRO/Model_Domain/SingletonModel/CoordinateSingleton/UserCoordinate.swift similarity index 100% rename from AVIRO/Model/SingletonModel/CoordinateSingleton/UserCoordinate.swift rename to AVIRO/Model_Domain/SingletonModel/CoordinateSingleton/UserCoordinate.swift diff --git a/AVIRO/Model/SingletonModel/MyData/MyData.swift b/AVIRO/Model_Domain/SingletonModel/MyData/MyData.swift similarity index 100% rename from AVIRO/Model/SingletonModel/MyData/MyData.swift rename to AVIRO/Model_Domain/SingletonModel/MyData/MyData.swift diff --git a/AVIRO/Model/UserModel/AppleUserLoginModel.swift b/AVIRO/Model_Domain/UserModel/AppleUserLoginModel.swift similarity index 100% rename from AVIRO/Model/UserModel/AppleUserLoginModel.swift rename to AVIRO/Model_Domain/UserModel/AppleUserLoginModel.swift diff --git a/AVIRO/Model_Domain/WelcomeModel/WelcomePopups.swift b/AVIRO/Model_Domain/WelcomeModel/WelcomePopups.swift new file mode 100644 index 00000000..18e09bf8 --- /dev/null +++ b/AVIRO/Model_Domain/WelcomeModel/WelcomePopups.swift @@ -0,0 +1,20 @@ +// +// WelcomePopups.swift +// AVIRO +// +// Created by 전성훈 on 8/26/24. +// + +import Foundation + +enum WelcomePopupEvent { + case MTCH +} + +struct WelcomePopup { + let title: String + let imageURL: URL + let url: URL? + let event: WelcomePopupEvent? + let buttonColor: String +} diff --git a/AVIRO/Scene/Base/TabBar/AVIROTabBarController.swift b/AVIRO/Scene/Base/TabBar/AVIROTabBarController.swift index 9afc04ed..ec3d16a8 100644 --- a/AVIRO/Scene/Base/TabBar/AVIROTabBarController.swift +++ b/AVIRO/Scene/Base/TabBar/AVIROTabBarController.swift @@ -39,7 +39,7 @@ final class AVIROTabBarController: UIViewController, TabBarFromSubVCDelegate { private lazy var tabBarBlurView = BlurEffectView() - private lazy var wellcomeView: UIView = { + private lazy var welcomeView: UIView = { let view = UIView() view.backgroundColor = .clear @@ -152,7 +152,7 @@ final class AVIROTabBarController: UIViewController, TabBarFromSubVCDelegate { bottomInsetView, tabBarBlurView, blurView, - wellcomeView + welcomeView ].forEach { $0.translatesAutoresizingMaskIntoConstraints = false self.view.addSubview($0) @@ -179,10 +179,10 @@ final class AVIROTabBarController: UIViewController, TabBarFromSubVCDelegate { blurView.trailingAnchor.constraint(equalTo: self.view.trailingAnchor), blurView.bottomAnchor.constraint(equalTo: self.view.bottomAnchor), - wellcomeView.centerXAnchor.constraint(equalTo: self.view.centerXAnchor), - wellcomeView.centerYAnchor.constraint(equalTo: self.view.centerYAnchor), - wellcomeView.widthAnchor.constraint(equalToConstant: 280), - wellcomeView.heightAnchor.constraint(equalToConstant: 415) + welcomeView.centerXAnchor.constraint(equalTo: self.view.centerXAnchor), + welcomeView.centerYAnchor.constraint(equalTo: self.view.centerYAnchor), + welcomeView.widthAnchor.constraint(equalToConstant: 280), + welcomeView.heightAnchor.constraint(equalToConstant: 420) ]) } @@ -191,7 +191,7 @@ final class AVIROTabBarController: UIViewController, TabBarFromSubVCDelegate { setupButtons() - checkWellcomeShow() + checkWelcomeShow() } private func setupButtons() { @@ -244,8 +244,8 @@ final class AVIROTabBarController: UIViewController, TabBarFromSubVCDelegate { ]) } - // MARK: - Wellcome VC - private func checkWellcomeShow() { + // MARK: - Welcome VC + private func checkWelcomeShow() { guard UserDefaults.standard.bool( forKey: UDKey.tutorialHome.rawValue ) else { return } @@ -289,21 +289,25 @@ final class AVIROTabBarController: UIViewController, TabBarFromSubVCDelegate { self?.selectedIndex = 2 } + self?.welcomeViewController?.didPushURL = { url in + self?.showWebView(with: url) + } + self?.blurView.isHidden = false - self?.wellcomeView.isHidden = false + self?.welcomeView.isHidden = false } } private func removeWelcomeVC() { blurView.isHidden = true - wellcomeView.isHidden = true + welcomeView.isHidden = true welcomeViewController?.remove() welcomeViewController = nil } func activeCheckWellcome() { - checkWellcomeShow() + checkWelcomeShow() } // MARK: - TabBar Click After diff --git a/AVIRO/Scene/Feature/Tutorial/TutorialViewController.swift b/AVIRO/Scene/Feature/Tutorial/TutorialViewController.swift index 58d480c1..ceb8ba64 100644 --- a/AVIRO/Scene/Feature/Tutorial/TutorialViewController.swift +++ b/AVIRO/Scene/Feature/Tutorial/TutorialViewController.swift @@ -105,6 +105,12 @@ final class TutorialViewController: UIViewController { pageControl.currentPageIndicatorTintColor = .main pageControl.pageIndicatorTintColor = .gray5 + pageControl.addTarget( + self, + action: #selector(pageControlTapped(_:)), + for: .valueChanged + ) + return pageControl }() @@ -179,6 +185,21 @@ final class TutorialViewController: UIViewController { } } + @objc private func pageControlTapped(_ sender: UIPageControl) { + let currentPage = sender.currentPage + + let indexPath = IndexPath(item: currentPage, section: 0) + + topCollectionView.scrollToItem( + at: indexPath, + at: .centeredHorizontally, + animated: true + ) + + // 버튼 상태도 업데이트 + changeButton() + } + @objc func tappedButton() { pushLoginView() } diff --git a/AVIRO/Scene/Feature/Welcome/WelcomeCollectionViewCell.swift b/AVIRO/Scene/Feature/Welcome/WelcomeCollectionViewCell.swift index b2098c3f..51925b6e 100644 --- a/AVIRO/Scene/Feature/Welcome/WelcomeCollectionViewCell.swift +++ b/AVIRO/Scene/Feature/Welcome/WelcomeCollectionViewCell.swift @@ -93,12 +93,12 @@ final class WelcomeCollectionViewCell: UICollectionViewCell { self.backgroundColor = .clear self.clipsToBounds = true - self.layer.cornerRadius = 15 + self.layer.cornerRadius = 16 } // TODO: 추후 모델링 - func configure(with url: URL) { - URLSession.shared.dataTask(with: url) { [weak self] data, _, error in + func configure(with welcomePopupData: WelcomePopup) { + URLSession.shared.dataTask(with: welcomePopupData.imageURL) { [weak self] data, _, error in guard let self = self else { return } if let _ = error { @@ -113,6 +113,10 @@ final class WelcomeCollectionViewCell: UICollectionViewCell { } } }.resume() + + checkButton.backgroundColor = UIColor( + hex: welcomePopupData.buttonColor + ) } private func imageLoadFail() { diff --git a/AVIRO/Scene/Feature/Welcome/WelcomeViewController.swift b/AVIRO/Scene/Feature/Welcome/WelcomeViewController.swift index 353036f0..a190da19 100644 --- a/AVIRO/Scene/Feature/Welcome/WelcomeViewController.swift +++ b/AVIRO/Scene/Feature/Welcome/WelcomeViewController.swift @@ -14,22 +14,31 @@ final class WelcomeViewController: UIViewController { private var amplitude: AmplitudeProtocol? - private var images: [URL] = [] { + private var welcomePopups : [WelcomePopup] = [] { didSet { imageCollectionView.reloadData() + viewPageControl.numberOfPages = welcomePopups.count } } private lazy var imageCollectionView: UICollectionView = { let layout = UICollectionViewFlowLayout() - let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout) + layout.scrollDirection = .horizontal + layout.minimumLineSpacing = 0 + + let collectionView = UICollectionView( + frame: .zero, + collectionViewLayout: layout + ) collectionView.showsHorizontalScrollIndicator = false collectionView.alwaysBounceHorizontal = false collectionView.backgroundColor = .clear collectionView.dataSource = self collectionView.delegate = self + collectionView.isPagingEnabled = true + collectionView.layer.cornerRadius = 16 collectionView.register( WelcomeCollectionViewCell.self, @@ -39,9 +48,25 @@ final class WelcomeViewController: UIViewController { return collectionView }() + private lazy var viewPageControl: UIPageControl = { + let pageControl = UIPageControl() + + pageControl.currentPage = 0 + pageControl.currentPageIndicatorTintColor = .main + pageControl.pageIndicatorTintColor = .gray5 + + pageControl.addTarget( + self, + action: #selector(pageControlTapped(_:)), + for: .valueChanged + ) + + return pageControl + }() + private lazy var failureLabel: UILabel = { let lbl = UILabel() - + lbl.text = "이미지 로딩에 실패했습니다" lbl.numberOfLines = 2 lbl.textColor = .gray2 @@ -58,7 +83,12 @@ final class WelcomeViewController: UIViewController { btn.setTitle("오늘 하루 보지 않기", for: .normal) btn.setTitleColor(.gray7, for: .normal) btn.titleLabel?.font = .pretendard(size: 18, weight: .medium) - btn.titleEdgeInsets = .init(top: 0, left: 0, bottom: -10, right: 0) + btn.titleEdgeInsets = .init( + top: 0, + left: 0, + bottom: -10, + right: 0 + ) btn.addTarget( self, @@ -71,7 +101,7 @@ final class WelcomeViewController: UIViewController { private lazy var separatorLabel: UILabel = { let lbl = UILabel() - + lbl.backgroundColor = .clear lbl.text = "|" lbl.font = .pretendard(size: 18, weight: .medium) @@ -87,8 +117,13 @@ final class WelcomeViewController: UIViewController { btn.setTitle("닫기", for: .normal) btn.setTitleColor(.gray7, for: .normal) btn.titleLabel?.font = .pretendard(size: 18, weight: .medium) - btn.titleEdgeInsets = .init(top: 0, left: 0, bottom: -10, right: 0) - + btn.titleEdgeInsets = .init( + top: 0, + left: 0, + bottom: -10, + right: 0 + ) + btn.addTarget( self, action: #selector(closeButtonTapped(_:)), @@ -100,7 +135,7 @@ final class WelcomeViewController: UIViewController { private lazy var bottomStackView: UIStackView = { let view = UIStackView() - + view.backgroundColor = .clear view.distribution = .fillProportionally view.alignment = .bottom @@ -112,13 +147,14 @@ final class WelcomeViewController: UIViewController { static func create() -> WelcomeViewController { let vc = WelcomeViewController() - + return vc } var didTappedNoShowButton: (() -> Void)? var didTappedCloseButton: (() -> Void)? var didTappedCheckButton: (() -> Void)? + var didPushURL: ((URL) -> Void)? override func viewDidLoad() { super.viewDidLoad() @@ -140,7 +176,8 @@ final class WelcomeViewController: UIViewController { [ imageCollectionView, bottomStackView, - failureLabel + failureLabel, + viewPageControl ].forEach { $0.translatesAutoresizingMaskIntoConstraints = false self.view.addSubview($0) @@ -152,6 +189,14 @@ final class WelcomeViewController: UIViewController { imageCollectionView.trailingAnchor.constraint(equalTo: self.view.trailingAnchor), imageCollectionView.heightAnchor.constraint(equalToConstant: 380), + viewPageControl.bottomAnchor.constraint( + equalTo: imageCollectionView.bottomAnchor, + constant: -56 + ), + viewPageControl.centerXAnchor.constraint( + equalTo: imageCollectionView.centerXAnchor + ), + bottomStackView.topAnchor.constraint(equalTo: imageCollectionView.bottomAnchor), bottomStackView.leadingAnchor.constraint(equalTo: self.view.leadingAnchor, constant: 30.5), bottomStackView.trailingAnchor.constraint(equalTo: self.view.trailingAnchor, constant: -30.5), @@ -167,17 +212,22 @@ final class WelcomeViewController: UIViewController { } func loadWelcomeImage(completionHandler: @escaping () -> Void) { - AVIROAPI.manager.loadWellcomeImagesURL { [weak self] result in + AVIROAPI.manager.loadWelcomePopups { [weak self] result in guard let self = self else { return } DispatchQueue.main.async { switch result { case .success(let data): - if let imageURL = data.data?.imageUrl { - guard let url = URL(string: imageURL) else { return } - let urlArray = [url] + if let orderedData = data.data? + .sorted(by: { $0.order < $1.order }) + .map({ $0.toDomain() }) { self.urlLoadFail(with: false) + completionHandler() + + self.welcomePopups = orderedData - self.images = urlArray + completionHandler() + } else { + self.urlLoadFail(with: true) completionHandler() } case .failure(let _): @@ -188,6 +238,18 @@ final class WelcomeViewController: UIViewController { } } + @objc private func pageControlTapped(_ sender: UIPageControl) { + let currentPage = sender.currentPage + + let indexPath = IndexPath(item: currentPage, section: 0) + + imageCollectionView.scrollToItem( + at: indexPath, + at: .centeredHorizontally, + animated: true + ) + } + private func urlLoadFail(with isFail: Bool) { failureLabel.isHidden = !isFail } @@ -209,6 +271,12 @@ extension WelcomeViewController: UICollectionViewDelegateFlowLayout { ) -> CGSize { return CGSize(width: 280, height: 380) } + + func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { + let page = Int(scrollView.contentOffset.x / scrollView.frame.size.width) + + viewPageControl.currentPage = page + } } extension WelcomeViewController: UICollectionViewDataSource { @@ -216,11 +284,11 @@ extension WelcomeViewController: UICollectionViewDataSource { _ collectionView: UICollectionView, numberOfItemsInSection section: Int ) -> Int { - return images.count + return welcomePopups.count } func collectionView( - _ collectionView: UICollectionView, + _ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath ) -> UICollectionViewCell { guard let cell = collectionView.dequeueReusableCell( @@ -228,12 +296,27 @@ extension WelcomeViewController: UICollectionViewDataSource { for: indexPath ) as? WelcomeCollectionViewCell else { return UICollectionViewCell() } - cell.configure(with: images[indexPath.row]) + cell.configure(with: welcomePopups[indexPath.row]) cell.didTappedCheckButton = { [weak self] in - self?.didTappedCheckButton?() +// self?.didTappedCheckButton?() + self?.didTappedPopup(index: indexPath.row) } return cell } + + private func didTappedPopup(index: Int) { + let tappedPopup = welcomePopups[index] + + if let url = tappedPopup.url { + didPushURL?(url) + return + } + + if let event = tappedPopup.event { + didTappedCheckButton?() + return + } + } }