File tree Expand file tree Collapse file tree
Projects/Modules/Networks/Sources Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88
99import Foundation
1010
11- struct BaseResponse < T: Decodable > : Decodable {
11+ struct BaseResponse < T: Decodable & Sendable > : Decodable , Sendable {
1212 let code : String
1313 let message : String
1414 let data : T ?
Original file line number Diff line number Diff line change 88
99import Foundation
1010
11- struct EmptyResponse : Decodable { }
11+ struct EmptyResponse : Decodable , Sendable { }
Original file line number Diff line number Diff line change 88
99import Foundation
1010
11- public struct ErrorResponse : Decodable {
11+ public struct ErrorResponse : Decodable , Sendable {
1212 public let code : String ?
1313 public let message : String ?
1414 public let errors : [ ErrorDetail ] ?
1515
16- public struct ErrorDetail : Decodable {
16+ public struct ErrorDetail : Decodable , Sendable {
1717 public let field : String ?
1818 public let message : String ?
1919 }
Original file line number Diff line number Diff line change 88
99import Foundation
1010
11- public enum NetworkError : Error {
11+ public enum NetworkError : Error , Sendable {
1212 case connectionFailed
1313 case decodingFailed
14- case unknown( Error )
14+ case unknown( String )
1515
1616 public var message : String {
1717 switch self {
1818 case . connectionFailed:
1919 return " 네트워크 연결을 확인해주세요 "
2020 case . decodingFailed:
2121 return " 데이터 처리 중 오류가 발생했습니다 "
22- case . unknown:
23- return " 알 수 없는 오류가 발생했습니다 "
22+ case . unknown( let description ) :
23+ return " 알 수 없는 오류: \( description ) "
2424 }
2525 }
2626}
Original file line number Diff line number Diff line change 99import Foundation
1010
1111@frozen
12- public enum NetworkResult < T, E: APIErrorProtocol > {
12+ public enum NetworkResult < T: Sendable , E: APIErrorProtocol & Sendable > : Sendable {
1313 case success( T )
1414 case failure( E )
1515 case networkFailure( NetworkError )
Original file line number Diff line number Diff line change 88
99import Foundation
1010
11- public struct SignupRequest : Encodable {
11+ public struct SignupRequest : Encodable , Sendable {
1212 public let fcmToken : String
1313 public let deviceModel : String ?
1414 public let deviceOs : String ?
@@ -30,7 +30,7 @@ public struct SignupRequest: Encodable {
3030 }
3131}
3232
33- public struct SignupResponse : Decodable {
33+ public struct SignupResponse : Decodable , Sendable {
3434 public let uuid : String
3535 public let accessToken : String
3636 public let nickname : String
Original file line number Diff line number Diff line change 99import Foundation
1010
1111
12- public enum SignupField {
12+ public enum SignupField : Sendable {
1313 case fcmToken
1414 case unknown( String )
1515
@@ -22,13 +22,13 @@ public enum SignupField {
2222}
2323
2424// MARK: - Error
25- public struct SignupError : APIErrorProtocol {
25+ public struct SignupError : APIErrorProtocol , Sendable {
2626 public let type : ErrorType
2727 public let message : String
2828 public let field : SignupField ?
2929 public let fieldMessage : String ?
3030
31- public enum ErrorType {
31+ public enum ErrorType : Sendable {
3232 case validationError
3333 case internalServerError
3434 case undefined( code: String )
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import Moya
1212extension MoyaProvider {
1313 private static var successCode : String { " 2000 " }
1414
15- func request< T: Decodable , E: APIErrorProtocol > (
15+ func request< T: Decodable & Sendable , E: APIErrorProtocol & Sendable > (
1616 _ target: Target ,
1717 errorType: E . Type
1818 ) async -> NetworkResult < T , E > {
@@ -56,7 +56,7 @@ extension MoyaProvider {
5656 }
5757 }
5858
59- func requestPlain< E: APIErrorProtocol > (
59+ func requestPlain< E: APIErrorProtocol & Sendable > (
6060 _ target: Target ,
6161 errorType: E . Type
6262 ) async -> NetworkResult < Void , E > {
@@ -102,7 +102,7 @@ extension MoyaProvider {
102102 where nsError. domain == NSURLErrorDomain:
103103 return . connectionFailed
104104 default :
105- return . unknown( error)
105+ return . unknown( error. localizedDescription )
106106 }
107107 }
108108}
You can’t perform that action at this time.
0 commit comments