Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ittzggd committed Jun 3, 2024
1 parent 53fac15 commit e53f264
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 144 deletions.
4 changes: 0 additions & 4 deletions HANE24/View/MainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ import SwiftUI

struct MainView: View {
@EnvironmentObject var hane: Hane
<<<<<<< HEAD
=======

>>>>>>> 247afaff37f2a91312f2c7d69e5d7375b12c8493
@StateObject var homeVM = HomeVM()

@State var selection = 1
Expand Down
50 changes: 0 additions & 50 deletions HANE24/View/More/AlertView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
13 changes: 0 additions & 13 deletions HANE24/ViewModel/NetworkManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,10 @@ enum RequestMethod: String {
}

protocol NetworkProtocol {
<<<<<<< HEAD
var session: URLSession { get }
var apiRoot: String { get }

func apiRequest<T>(_ urlPath: String, _ method: RequestMethod, type: T.Type?) async throws -> T? where T: Decodable
=======

var session: URLSession { get }
var apiRoot: String { get }

func apiRequest<T>(_ urlPath: String, _ method: RequestMethod, type: T.Type?) async throws -> T? where T: Decodable

>>>>>>> efa5edf07a77692b85f4df2181e7aa8c0393209d
}

class NetworkManager: NetworkProtocol {
Expand Down Expand Up @@ -93,8 +84,4 @@ class NetworkManager: NetworkProtocol {
throw MyError.tokenExpired("request Failed")
}
}
<<<<<<< HEAD

=======
>>>>>>> efa5edf07a77692b85f4df2181e7aa8c0393209d
}
77 changes: 0 additions & 77 deletions HANE24TEST/HANE24Test.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>(_ 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!
Expand Down

0 comments on commit e53f264

Please sign in to comment.