Skip to content

Commit

Permalink
fix/#225 코드리뷰반영
Browse files Browse the repository at this point in the history
  • Loading branch information
hooni0918 committed Jul 18, 2024
1 parent efa3aab commit 20a423d
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 33 deletions.
14 changes: 13 additions & 1 deletion KkuMulKum.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
785AE1C02C2E878600677CA0 /* FirebaseVertexAI-Preview in Frameworks */ = {isa = PBXBuildFile; productRef = 785AE1BF2C2E878600677CA0 /* FirebaseVertexAI-Preview */; };
785AE1D12C3B07A600677CA0 /* PrivacyInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 785AE1D02C3B07A600677CA0 /* PrivacyInfo.plist */; };
789196362C492F8600FF8CDF /* AuthTargetType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 789196352C492F8600FF8CDF /* AuthTargetType.swift */; };
789196382C49697B00FF8CDF /* AuthError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 789196372C49697B00FF8CDF /* AuthError.swift */; };
789873322C3D1A7B00435E96 /* LoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7898732F2C3D1A7B00435E96 /* LoginViewController.swift */; };
789873332C3D1A7B00435E96 /* LoginViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 789873302C3D1A7B00435E96 /* LoginViewModel.swift */; };
789873342C3D1A7B00435E96 /* LoginView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 789873312C3D1A7B00435E96 /* LoginView.swift */; };
Expand Down Expand Up @@ -239,6 +240,7 @@
782B40812C3E4925008B0CA7 /* NicknameViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NicknameViewModel.swift; sourceTree = "<group>"; };
785AE1D02C3B07A600677CA0 /* PrivacyInfo.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = PrivacyInfo.plist; sourceTree = "<group>"; };
789196352C492F8600FF8CDF /* AuthTargetType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthTargetType.swift; sourceTree = "<group>"; };
789196372C49697B00FF8CDF /* AuthError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthError.swift; sourceTree = "<group>"; };
7898732F2C3D1A7B00435E96 /* LoginViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginViewController.swift; sourceTree = "<group>"; };
789873302C3D1A7B00435E96 /* LoginViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginViewModel.swift; sourceTree = "<group>"; };
789873312C3D1A7B00435E96 /* LoginView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -514,6 +516,15 @@
path = ViewModel;
sourceTree = "<group>";
};
789196392C49697F00FF8CDF /* Auth */ = {
isa = PBXGroup;
children = (
789196372C49697B00FF8CDF /* AuthError.swift */,
789196352C492F8600FF8CDF /* AuthTargetType.swift */,
);
path = Auth;
sourceTree = "<group>";
};
789873352C3D1B3000435E96 /* View */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1122,7 +1133,7 @@
DDE7D2BE2C470A58005A921F /* TargetType */ = {
isa = PBXGroup;
children = (
789196352C492F8600FF8CDF /* AuthTargetType.swift */,
789196392C49697F00FF8CDF /* Auth */,
DDE7D2BF2C470A58005A921F /* LoginTargetType.swift */,
DDE7D2C02C470A58005A921F /* ProfileTargetType.swift */,
DDE7D2C12C470A58005A921F /* NicknameTargetType.swift */,
Expand Down Expand Up @@ -1703,6 +1714,7 @@
DD8626622C4606A300E4F980 /* ReadyStatusViewModel.swift in Sources */,
DD3F9DC22C481ED5008E1FF7 /* MeetingService.swift in Sources */,
DE6D4D102C3F14D80005584B /* InvitationCodePopUpView.swift in Sources */,
789196382C49697B00FF8CDF /* AuthError.swift in Sources */,
A39F2B1B2C47C206008DA5F5 /* SetReadyCompletedViewController.swift in Sources */,
DDFA50812C4693BD000A62E2 /* ProfileSetupViewController.swift in Sources */,
DD30721A2C3C011600416D9F /* AddPromiseRequestModel.swift in Sources */,
Expand Down
7 changes: 1 addition & 6 deletions KkuMulKum/Network/Service/AuthService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,7 @@ class AuthService: AuthServiceType {

func performRequest<T: ResponseModelType>(
_ target: AuthTargetType,
completion: @escaping (
Result<
T,
NetworkError
>
) -> Void
completion: @escaping (Result<T, NetworkError>) -> Void
) {
provider.request(target) { result in
switch result {
Expand Down
34 changes: 34 additions & 0 deletions KkuMulKum/Network/TargetType/Auth/AuthError.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// AuthError.swift
// KkuMulKum
//
// Created by 이지훈 on 7/19/24.
//

import Foundation

enum NetworkError: Error {
case invalidImageFormat
case imageSizeExceeded
case userNotFound
case decodingError
case networkError
case unknownError(String)

var message: String {
switch self {
case .invalidImageFormat:
return "이미지 확장자는 jpg, png, webp만 가능합니다."
case .imageSizeExceeded:
return "이미지 사이즈는 5MB를 넘을 수 없습니다."
case .userNotFound:
return "유저를 찾을 수 없습니다."
case .decodingError:
return "데이터 디코딩 중 오류가 발생했습니다."
case .networkError:
return "네트워크 오류가 발생했습니다."
case .unknownError(let message):
return message
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,6 @@ import Foundation

import Moya

enum NetworkError: Error {
case invalidImageFormat
case imageSizeExceeded
case userNotFound
case decodingError
case networkError
case unknownError(String)

var message: String {
switch self {
case .invalidImageFormat:
return "이미지 확장자는 jpg, png, webp만 가능합니다."
case .imageSizeExceeded:
return "이미지 사이즈는 5MB를 넘을 수 없습니다."
case .userNotFound:
return "유저를 찾을 수 없습니다."
case .decodingError:
return "데이터 디코딩 중 오류가 발생했습니다."
case .networkError:
return "네트워크 오류가 발생했습니다."
case .unknownError(let message):
return message
}
}
}

enum AuthTargetType {
case appleLogin(identityToken: String, fcmToken: String)
case kakaoLogin(accessToken: String, fcmToken: String)
Expand Down

0 comments on commit 20a423d

Please sign in to comment.