From d7bdb5e93e92155d155ada9766a6865ce9c0ce99 Mon Sep 17 00:00:00 2001 From: loinsir Date: Wed, 6 Dec 2023 14:12:30 +0900 Subject: [PATCH] =?UTF-8?q?:wrench:=20=EC=BD=94=EB=93=9C=20=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20=EB=B3=80=EA=B2=BD,=20Mock=20?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EA=B5=90=EC=B2=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Layover/Network/DTOs/CheckSignUpDTO.swift | 2 +- .../Layover/Network/Mock/MockData/CheckSignUp.json | 2 +- .../Layover/Network/Mock/MockData/LoginData.json | 14 +++++++------- .../Layover/Scenes/Login/LoginInteractor.swift | 8 ++++---- iOS/Layover/Layover/Scenes/Login/LoginWorker.swift | 4 ++-- .../Layover/Workers/Mocks/MockLoginWorker.swift | 4 ++-- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/iOS/Layover/Layover/Network/DTOs/CheckSignUpDTO.swift b/iOS/Layover/Layover/Network/DTOs/CheckSignUpDTO.swift index 3a1ea7c..f50d020 100644 --- a/iOS/Layover/Layover/Network/DTOs/CheckSignUpDTO.swift +++ b/iOS/Layover/Layover/Network/DTOs/CheckSignUpDTO.swift @@ -9,5 +9,5 @@ import Foundation struct CheckSignUpDTO: Decodable { - let isValid: Bool + let isAlreadyExist: Bool } diff --git a/iOS/Layover/Layover/Network/Mock/MockData/CheckSignUp.json b/iOS/Layover/Layover/Network/Mock/MockData/CheckSignUp.json index a976fb8..254727a 100644 --- a/iOS/Layover/Layover/Network/Mock/MockData/CheckSignUp.json +++ b/iOS/Layover/Layover/Network/Mock/MockData/CheckSignUp.json @@ -3,6 +3,6 @@ "message": "성공", "statusCode": 200, "data": { - "isValid": true + "isAlreadyExist": true } } diff --git a/iOS/Layover/Layover/Network/Mock/MockData/LoginData.json b/iOS/Layover/Layover/Network/Mock/MockData/LoginData.json index 2fd9362..f378e18 100644 --- a/iOS/Layover/Layover/Network/Mock/MockData/LoginData.json +++ b/iOS/Layover/Layover/Network/Mock/MockData/LoginData.json @@ -1,9 +1,9 @@ { - "customCode": "SUCCESS", - "message": "성공", - "statusCode": 200, - "data": { - "accessToken": "mockAccessToken", - "refreshToken": "mockRefreshToken" - } + "customCode": "SUCCESS", + "message": "성공", + "statusCode": 200, + "data": { + "accessToken": "mockAccessToken", + "refreshToken": "mockRefreshToken" + } } diff --git a/iOS/Layover/Layover/Scenes/Login/LoginInteractor.swift b/iOS/Layover/Layover/Scenes/Login/LoginInteractor.swift index 1292fbf..0b63af2 100644 --- a/iOS/Layover/Layover/Scenes/Login/LoginInteractor.swift +++ b/iOS/Layover/Layover/Scenes/Login/LoginInteractor.swift @@ -43,7 +43,7 @@ extension LoginInteractor: LoginBusinessLogic { guard let token = await worker?.fetchKakaoLoginToken() else { return } kakaoLoginToken = token if await worker?.isRegisteredKakao(with: token) == true, - await worker?.loginKakao(with: token) == true { + await worker?.loginKakao(with: token) == true { await MainActor.run { presenter?.presentPerformLogin() } @@ -77,10 +77,10 @@ extension LoginInteractor: ASAuthorizationControllerDelegate { } appleLoginToken = identityToken Task { - async let isRegistered: Bool = worker?.isRegisteredApple(with: identityToken) ?? false - async let loginResult: Bool = worker?.loginApple(with: identityToken) ?? false + let isRegistered = await worker?.isRegisteredApple(with: identityToken) + let loginResult = await worker?.loginApple(with: identityToken) - if await !isRegistered, await loginResult { + if isRegistered == true, loginResult == true { await MainActor.run { presenter?.presentPerformLogin() } diff --git a/iOS/Layover/Layover/Scenes/Login/LoginWorker.swift b/iOS/Layover/Layover/Scenes/Login/LoginWorker.swift index ff6acd3..e315645 100644 --- a/iOS/Layover/Layover/Scenes/Login/LoginWorker.swift +++ b/iOS/Layover/Layover/Scenes/Login/LoginWorker.swift @@ -73,7 +73,7 @@ extension LoginWorker: LoginWorkerProtocol { do { let endPoint = loginEndPointFactory.makeCheckKakaoIsSignedUpEndPoint(with: socialToken) let result = try await provider.request(with: endPoint, authenticationIfNeeded: false) - return result.data?.isValid + return result.data?.isAlreadyExist } catch { os_log(.error, log: .data, "%@", error.localizedDescription) return nil @@ -101,7 +101,7 @@ extension LoginWorker: LoginWorkerProtocol { do { let endPoint = loginEndPointFactory.makeCheckAppleIsSignedUpEndPoint(with: identityToken) let result = try await provider.request(with: endPoint, authenticationIfNeeded: false) - return result.data?.isValid + return result.data?.isAlreadyExist } catch { os_log(.error, log: .data, "%@", error.localizedDescription) return nil diff --git a/iOS/Layover/Layover/Workers/Mocks/MockLoginWorker.swift b/iOS/Layover/Layover/Workers/Mocks/MockLoginWorker.swift index 9aab6ce..b94518c 100644 --- a/iOS/Layover/Layover/Workers/Mocks/MockLoginWorker.swift +++ b/iOS/Layover/Layover/Workers/Mocks/MockLoginWorker.swift @@ -49,7 +49,7 @@ final class MockLoginWorker: LoginWorkerProtocol { method: .POST, bodyParameters: bodyParameters) let response = try await provider.request(with: endPoint, authenticationIfNeeded: false, retryCount: 0) - return response.data?.isValid + return response.data?.isAlreadyExist } catch { os_log(.error, log: .data, "%@", error.localizedDescription) return nil @@ -107,7 +107,7 @@ final class MockLoginWorker: LoginWorkerProtocol { method: .POST, bodyParameters: bodyParameters) let response = try await provider.request(with: endPoint, authenticationIfNeeded: false, retryCount: 0) - return response.data?.isValid + return response.data?.isAlreadyExist } catch { os_log(.error, log: .data, "%@", error.localizedDescription) return nil