diff --git a/.gitignore b/.gitignore index 6e26e352..43cede35 100644 --- a/.gitignore +++ b/.gitignore @@ -79,6 +79,7 @@ Tuist/Dependencies .DS_Store .AppleDouble .LSOverride +*.xcconfig # Icon must end with two \r Icon diff --git a/Projects/App/Support/Info.plist b/Projects/App/Support/Info.plist index decda402..d5e0df73 100644 --- a/Projects/App/Support/Info.plist +++ b/Projects/App/Support/Info.plist @@ -17,19 +17,28 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.5.0 + 1.5.1 CFBundleVersion 1 + CloudTypeBaseURL + $(CloudTypeBaseURL) FirebaseAppDelegateProxyEnabled LSRequiresIPhoneOS Localization native development region Korea + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + NSCameraUsageDescription QR 스캔을 위해 카메라를 허용해주세요. SERVER_HOST ${SERVER_HOST} + SchoolBaseURL + $(SchoolBaseURL) UIApplicationSceneManifest UIApplicationSupportsMultipleScenes diff --git a/Projects/Feature/Sources/Scene/Outing/User/View/OutingViewController.swift b/Projects/Feature/Sources/Scene/Outing/User/View/OutingViewController.swift index 39b10ad2..1e5564e1 100644 --- a/Projects/Feature/Sources/Scene/Outing/User/View/OutingViewController.swift +++ b/Projects/Feature/Sources/Scene/Outing/User/View/OutingViewController.swift @@ -125,7 +125,7 @@ public final class OutingViewController: BaseViewController { searchController.searchBar.placeholder = "학생 검색" searchController.searchResultsUpdater = self } - + private func setupCollectionView() { self.outingListCollectionView.dataSource = self self.outingListCollectionView.delegate = self diff --git a/Projects/Service/Sources/General/BaseURL.swift b/Projects/Service/Sources/General/BaseURL.swift deleted file mode 100644 index 1161d7b0..00000000 --- a/Projects/Service/Sources/General/BaseURL.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// BaseURL.swift -// Service -// -// Created by 새미 on 3/30/24. -// Copyright © 2024 HARIBO. All rights reserved. -// - -import Foundation - -public struct BaseURL { - public static let baseURL = Bundle.main.object(forInfoDictionaryKey: "SERVER_HOST") as! String -} - diff --git a/Projects/Service/Sources/Services/Account/AccountServices.swift b/Projects/Service/Sources/Services/Account/AccountServices.swift index b2bc0143..0b069cd3 100644 --- a/Projects/Service/Sources/Services/Account/AccountServices.swift +++ b/Projects/Service/Sources/Services/Account/AccountServices.swift @@ -17,17 +17,21 @@ public enum AccountServices { extension AccountServices: TargetType { public var baseURL: URL { - return URL(string: "https://port-0-goms-backend-v2-12fhqa2bln49rbi0.sel5.cloudtype.app/api/v2/account")! + guard let urlString = Bundle.main.infoDictionary?["SchoolBaseURL"] as? String, + let url = URL(string: urlString) else { + fatalError("AccountAPIㅣURL을 불러올 수 없습니다.") + } + return url } - + public var path: String { switch self { case .newPassword: - return "/new-password" + return "/account/new-password" case .changPassword: - return "/change-password" + return "/account/change-password" case .withdraw(let password, _): - return "/withdraw/\(password)" + return "/account/withdraw/\(password)" } } diff --git a/Projects/Service/Sources/Services/Auth/AuthServices.swift b/Projects/Service/Sources/Services/Auth/AuthServices.swift index 81e43c76..c692cca1 100644 --- a/Projects/Service/Sources/Services/Auth/AuthServices.swift +++ b/Projects/Service/Sources/Services/Auth/AuthServices.swift @@ -20,9 +20,13 @@ public enum AuthServices { extension AuthServices: TargetType { public var baseURL: URL { - return URL(string: "https://port-0-goms-backend-v2-12fhqa2bln49rbi0.sel5.cloudtype.app/api/v2")! + guard let urlString = Bundle.main.infoDictionary?["SchoolBaseURL"] as? String, + let url = URL(string: urlString) else { + fatalError("AuthAPIㅣURL을 불러올 수 없습니다.") + } + return url } - + public var path: String { switch self { case .signUp: diff --git a/Projects/Service/Sources/Services/Late/LateService.swift b/Projects/Service/Sources/Services/Late/LateService.swift index 4d24d0d0..9f993030 100644 --- a/Projects/Service/Sources/Services/Late/LateService.swift +++ b/Projects/Service/Sources/Services/Late/LateService.swift @@ -15,9 +15,13 @@ public enum LateService { extension LateService: TargetType { public var baseURL: URL { - return URL(string: "https://port-0-goms-backend-v2-12fhqa2bln49rbi0.sel5.cloudtype.app/api/v2")! + guard let urlString = Bundle.main.infoDictionary?["SchoolBaseURL"] as? String, + let url = URL(string: urlString) else { + fatalError("LateAPIㅣURL을 불러올 수 없습니다.") + } + return url } - + public var path: String { switch self { case .lateRank: diff --git a/Projects/Service/Sources/Services/Notification/NotificationService.swift b/Projects/Service/Sources/Services/Notification/NotificationService.swift index c36dd76f..fe0ec229 100644 --- a/Projects/Service/Sources/Services/Notification/NotificationService.swift +++ b/Projects/Service/Sources/Services/Notification/NotificationService.swift @@ -15,7 +15,11 @@ public enum NotificationServices { extension NotificationServices: TargetType { public var baseURL: URL { - return URL(string: "https://port-0-goms-backend-v2-12fhqa2bln49rbi0.sel5.cloudtype.app/api/v2/notification/token")! + guard let urlString = Bundle.main.infoDictionary?["SchoolBaseURL"] as? String, + let url = URL(string: urlString) else { + fatalError("NotificationAPIㅣURL을 불러올 수 없습니다.") + } + return url } public var path: String { diff --git a/Projects/Service/Sources/Services/Outing/OutingServices.swift b/Projects/Service/Sources/Services/Outing/OutingServices.swift index 57ab3b13..674d246f 100644 --- a/Projects/Service/Sources/Services/Outing/OutingServices.swift +++ b/Projects/Service/Sources/Services/Outing/OutingServices.swift @@ -18,9 +18,13 @@ public enum OutingServices { extension OutingServices: TargetType { public var baseURL: URL { - return URL(string: "https://port-0-goms-backend-v2-12fhqa2bln49rbi0.sel5.cloudtype.app/api/v2")! + guard let urlString = Bundle.main.infoDictionary?["SchoolBaseURL"] as? String, + let url = URL(string: urlString) else { + fatalError("OutingAPIㅣURL을 불러올 수 없습니다.") + } + return url } - + public var path: String { switch self { case .outing(let outingUUID, _): diff --git a/Projects/Service/Sources/Services/Profile/ProfileServices.swift b/Projects/Service/Sources/Services/Profile/ProfileServices.swift index 50772655..dc63f43d 100644 --- a/Projects/Service/Sources/Services/Profile/ProfileServices.swift +++ b/Projects/Service/Sources/Services/Profile/ProfileServices.swift @@ -13,19 +13,23 @@ struct ProfileImageResponse: Codable { extension ProfileServices: TargetType { public var baseURL: URL { - return URL(string: "https://port-0-goms-backend-v2-12fhqa2bln49rbi0.sel5.cloudtype.app/api/v2/account")! + guard let urlString = Bundle.main.infoDictionary?["SchoolBaseURL"] as? String, + let url = URL(string: urlString) else { + fatalError("ProfileAPIㅣURL을 불러올 수 없습니다.") + } + return url } - + public var path: String { switch self { case .getProfile: - return "/profile" + return "/account/profile" case .submit: - return "/image" + return "/account/image" case .update: - return "/image" + return "/account/image" case .delete: - return "" + return "/account" } } diff --git a/Projects/Service/Sources/Services/StudentCouncil/StudentCouncilServices.swift b/Projects/Service/Sources/Services/StudentCouncil/StudentCouncilServices.swift index 7d918960..9a4cf848 100644 --- a/Projects/Service/Sources/Services/StudentCouncil/StudentCouncilServices.swift +++ b/Projects/Service/Sources/Services/StudentCouncil/StudentCouncilServices.swift @@ -15,9 +15,13 @@ public enum StudentCouncilServices { extension StudentCouncilServices: TargetType { public var baseURL: URL { - return URL(string: "https://port-0-goms-backend-v2-12fhqa2bln49rbi0.sel5.cloudtype.app/api/v2")! + guard let urlString = Bundle.main.infoDictionary?["SchoolBaseURL"] as? String, + let url = URL(string: urlString) else { + fatalError("StudentCouncilㅣURL을 불러올 수 없습니다.") + } + return url } - + public var path: String { switch self { case .makeQRCode: