diff --git a/HANE24/View/MainView.swift b/HANE24/View/MainView.swift index f2182b4..14a97e0 100644 --- a/HANE24/View/MainView.swift +++ b/HANE24/View/MainView.swift @@ -9,10 +9,6 @@ import SwiftUI struct MainView: View { @EnvironmentObject var hane: Hane -<<<<<<< HEAD -======= - ->>>>>>> 247afaff37f2a91312f2c7d69e5d7375b12c8493 @StateObject var homeVM = HomeVM() @State var selection = 1 diff --git a/HANE24/View/More/AlertView.swift b/HANE24/View/More/AlertView.swift index a52fcbf..ba03a5c 100644 --- a/HANE24/View/More/AlertView.swift +++ b/HANE24/View/More/AlertView.swift @@ -57,56 +57,6 @@ struct AlertView: View { } .background(Color.gray.opacity(0.7)) } -<<<<<<< HEAD -<<<<<<< HEAD - - var submitButton: some View { - Button { - Task { - do { - try await NetworkManager.shared.apiRequest("/v2/reissue/request", .post) - hane.reissueState = .apply - } - } - showAlert = false - } label: { - ZStack { - RoundedRectangle(cornerRadius: 10) - .foregroundColor(.gradientPurple) - .frame(width: 250, height: 50) - Text("네, 신청하겠습니다") - .font(.system(size: 16, weight: .bold)) - .foregroundColor(.white) - } - } - } - - var receiveButton: some View { - Button { - Task { - do { - try await NetworkManager.shared.apiRequest("/v2/reissue/request", .patch) - hane.reissueState = .done - } catch { - hane.reissueState = .pickUpRequested - } - } - showAlert = false - } label: { - ZStack { - RoundedRectangle(cornerRadius: 10) - .foregroundColor(.gradientPurple) - .frame(width: 250, height: 50) - Text("네, 확인했습니다") - .font(.system(size: 16, weight: .bold)) - .foregroundColor(.white) - } - } - } -======= ->>>>>>> 247afaff37f2a91312f2c7d69e5d7375b12c8493 -======= ->>>>>>> efa5edf07a77692b85f4df2181e7aa8c0393209d } #Preview { diff --git a/HANE24/ViewModel/NetworkManager.swift b/HANE24/ViewModel/NetworkManager.swift index e310f8d..98c554b 100644 --- a/HANE24/ViewModel/NetworkManager.swift +++ b/HANE24/ViewModel/NetworkManager.swift @@ -17,19 +17,10 @@ enum RequestMethod: String { } protocol NetworkProtocol { -<<<<<<< HEAD var session: URLSession { get } var apiRoot: String { get } func apiRequest(_ urlPath: String, _ method: RequestMethod, type: T.Type?) async throws -> T? where T: Decodable -======= - - var session: URLSession { get } - var apiRoot: String { get } - - func apiRequest(_ urlPath: String, _ method: RequestMethod, type: T.Type?) async throws -> T? where T: Decodable - ->>>>>>> efa5edf07a77692b85f4df2181e7aa8c0393209d } class NetworkManager: NetworkProtocol { @@ -93,8 +84,4 @@ class NetworkManager: NetworkProtocol { throw MyError.tokenExpired("request Failed") } } -<<<<<<< HEAD - -======= ->>>>>>> efa5edf07a77692b85f4df2181e7aa8c0393209d } diff --git a/HANE24TEST/HANE24Test.swift b/HANE24TEST/HANE24Test.swift index 15f9fed..f55c834 100644 --- a/HANE24TEST/HANE24Test.swift +++ b/HANE24TEST/HANE24Test.swift @@ -8,84 +8,7 @@ import XCTest @testable import Hane -<<<<<<< HEAD -<<<<<<< HEAD -let emptyJsonData = """ - { - "login": "hoslim", - "profileImage": "blabla", - "inOutLogs": [], - "totalAccumulationTime": 0, - "acceptedAccumulationTime": 0 - } -""".data(using: .utf8)! - -let missingJsonData = """ - { - "login": "hoslim", - "profileImage": "https://cdn.intra.42.fr/users/8f20c45abe403f1fd56b58211f819bea/hoslim.jpg", - "inOutLogs": [ - { - "inTimeStamp": 1671095311, - "outTimeStamp": null, - "durationSecond": null - } - ], - "totalAccumulationTime": 750975, - "acceptedAccumulationTime": 737614 - } -""".data(using: .utf8)! - -let missingAnswer = [Log(inTime: Optional("18:08:31"), outTime: nil, logTime: Optional("누락"))] - -let emptyMonthlyData = PerMonth(login: "hoslim", profileImage: "https://cdn.intra.42.fr/users/8f20c45abe403f1fd56b58211f819bea/hoslim.jpg", inOutLogs: [], totalAccumulationTime: 0, acceptedAccumulationTime: 0) - -// 2022-12-30일자 기록 -let monthlyJsonData = """ - { - "login": "hoslim", - "profileImage": "https://cdn.intra.42.fr/users/8f20c45abe403f1fd56b58211f819bea/hoslim.jpg", - "inOutLogs": [ - { - "inTimeStamp": 1672370079, - "outTimeStamp": 1672386139, - "durationSecond": 16060 - } - ], - "totalAccumulationTime": 750975, - "acceptedAccumulationTime": 737614 - } -""".data(using: .utf8)! - -let answer = [Log(inTime: Optional("12:14:39"), outTime: Optional("16:42:19"), logTime: Optional("04:27:40"))] - -class MockNetwork: NetworkProtocol { - static var shared = MockNetwork() - - var session: URLSession - - var apiRoot: String = "" - - func apiRequest(_ urlPath: String, _ method: RequestMethod, type: T.Type?) async throws -> T? where T : Decodable { - if method == .get, type != nil { - let decodedData = try JSONDecoder().decode(type!.self, from: monthlyJsonData) - return decodedData - } - return nil - } - - private init(session: URLSession = URLSession.shared) { - self.session = session - } -} - -final class HaneCalendarTest: XCTestCase { -======= -final class CalendarTest: XCTestCase { ->>>>>>> 247afaff37f2a91312f2c7d69e5d7375b12c8493 -======= final class CalendarTest: XCTestCase { ->>>>>>> efa5edf07a77692b85f4df2181e7aa8c0393209d // CalendarVM 객체 var sut: CalendarVM!