diff --git a/DalTube/DalTube.xcodeproj/project.pbxproj b/DalTube/DalTube.xcodeproj/project.pbxproj index d1c1759..921ac39 100644 --- a/DalTube/DalTube.xcodeproj/project.pbxproj +++ b/DalTube/DalTube.xcodeproj/project.pbxproj @@ -22,6 +22,9 @@ 9A193E172773395C00231077 /* TagCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A193E152773395C00231077 /* TagCollectionViewCell.swift */; }; 9A193E182773395C00231077 /* TagCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9A193E162773395C00231077 /* TagCollectionViewCell.xib */; }; 9A193E1A27758AB700231077 /* APIConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A193E1927758AB700231077 /* APIConstants.swift */; }; + 9A193E1D27758B4900231077 /* NetworkResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A193E1C27758B4900231077 /* NetworkResult.swift */; }; + 9A193E1F27758BF600231077 /* LoginResponseDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A193E1E27758BF600231077 /* LoginResponseDataModel.swift */; }; + 9A193E2127758C5E00231077 /* UserSignService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A193E2027758C5E00231077 /* UserSignService.swift */; }; 9A43F82C27293CDD002DC0D5 /* CustomTabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A43F82B27293CDD002DC0D5 /* CustomTabBarController.swift */; }; 9A43F838272944A2002DC0D5 /* HomeVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A43F837272944A2002DC0D5 /* HomeVC.swift */; }; 9A43F83A272944B6002DC0D5 /* ShortsVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A43F839272944B6002DC0D5 /* ShortsVC.swift */; }; @@ -53,6 +56,9 @@ 9A193E152773395C00231077 /* TagCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TagCollectionViewCell.swift; sourceTree = ""; }; 9A193E162773395C00231077 /* TagCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TagCollectionViewCell.xib; sourceTree = ""; }; 9A193E1927758AB700231077 /* APIConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIConstants.swift; sourceTree = ""; }; + 9A193E1C27758B4900231077 /* NetworkResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkResult.swift; sourceTree = ""; }; + 9A193E1E27758BF600231077 /* LoginResponseDataModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginResponseDataModel.swift; sourceTree = ""; }; + 9A193E2027758C5E00231077 /* UserSignService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserSignService.swift; sourceTree = ""; }; 9A43F82B27293CDD002DC0D5 /* CustomTabBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTabBarController.swift; sourceTree = ""; }; 9A43F837272944A2002DC0D5 /* HomeVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeVC.swift; sourceTree = ""; }; 9A43F839272944B6002DC0D5 /* ShortsVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShortsVC.swift; sourceTree = ""; }; @@ -122,6 +128,8 @@ isa = PBXGroup; children = ( 9A193E1927758AB700231077 /* APIConstants.swift */, + 9A193E1C27758B4900231077 /* NetworkResult.swift */, + 9A193E1E27758BF600231077 /* LoginResponseDataModel.swift */, ); path = Network; sourceTree = ""; @@ -132,6 +140,7 @@ 9A53B769270A7D7800ECE343 /* LoginViewController.swift */, 9A53B76B270A7DEB00ECE343 /* SigninViewController.swift */, 9A53B76D270A7E0A00ECE343 /* WelcomeViewController.swift */, + 9A193E2027758C5E00231077 /* UserSignService.swift */, ); path = Login; sourceTree = ""; @@ -302,10 +311,13 @@ 9A04DCA52743E7BA0012658D /* HomeContentDataModel.swift in Sources */, 9A53B76A270A7D7800ECE343 /* LoginViewController.swift in Sources */, 9A193E1A27758AB700231077 /* APIConstants.swift in Sources */, + 9A193E1D27758B4900231077 /* NetworkResult.swift in Sources */, 9A43F838272944A2002DC0D5 /* HomeVC.swift in Sources */, + 9A193E1F27758BF600231077 /* LoginResponseDataModel.swift in Sources */, 9A04DCA22743E17F0012658D /* HomeTableViewCell.swift in Sources */, 9A43F82C27293CDD002DC0D5 /* CustomTabBarController.swift in Sources */, 9A193E13277333E500231077 /* HomeCollectionViewCell.swift in Sources */, + 9A193E2127758C5E00231077 /* UserSignService.swift in Sources */, 9A53B76C270A7DEB00ECE343 /* SigninViewController.swift in Sources */, 9A43F83C272944BF002DC0D5 /* AddVC.swift in Sources */, 9A1870822708521500228B78 /* ViewController.swift in Sources */, diff --git a/DalTube/DalTube.xcworkspace/xcuserdata/guest1.xcuserdatad/UserInterfaceState.xcuserstate b/DalTube/DalTube.xcworkspace/xcuserdata/guest1.xcuserdatad/UserInterfaceState.xcuserstate index 680a040..e6d2489 100644 Binary files a/DalTube/DalTube.xcworkspace/xcuserdata/guest1.xcuserdatad/UserInterfaceState.xcuserstate and b/DalTube/DalTube.xcworkspace/xcuserdata/guest1.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/DalTube/DalTube/Network/LoginResponseDataModel.swift b/DalTube/DalTube/Network/LoginResponseDataModel.swift new file mode 100644 index 0000000..d915dc3 --- /dev/null +++ b/DalTube/DalTube/Network/LoginResponseDataModel.swift @@ -0,0 +1,20 @@ +// This file was generated from JSON Schema using quicktype, do not modify it directly. +// To parse the JSON, add this file to your project and do: +// +// let welcome = try? newJSONDecoder().decode(Welcome.self, from: jsonData) + +import Foundation + +// MARK: - LoginResponseData +struct LoginResponseData: Codable { + let status: Int + let success: Bool + let message: String + let data: LoginResultData? +} + +// MARK: - LoginResultData +struct LoginResultData: Codable { + let id: Int + let name, email: String +} diff --git a/DalTube/DalTube/Network/NetworkResult.swift b/DalTube/DalTube/Network/NetworkResult.swift new file mode 100644 index 0000000..6bbcd34 --- /dev/null +++ b/DalTube/DalTube/Network/NetworkResult.swift @@ -0,0 +1,16 @@ +// +// NetworkResult.swift +// DalTube +// +// Created by 김선오 on 2021/12/24. +// + +import Foundation + +enum NetworkResult { + case success(T) + case requestErr(T) + case pathErr + case serverErr + case networkFail +}