Skip to content

Commit

Permalink
[Chore/#92] 폴더 네이밍 및 위치 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
HELLOHIDI committed Oct 14, 2024
1 parent e93c3e0 commit d96dfd7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,23 @@
//

import Foundation

struct ErrorResponse: Decodable {
var statusCode: Int
var message: String
var data: String?

enum CodingKeys: CodingKey {
case statusCode
case message
case data
}

init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.statusCode = (try? container.decode(Int.self, forKey: .statusCode)) ?? 500
self.message = (try? container.decode(String.self, forKey: .message)) ?? ""
self.data = try container.decodeIfPresent(String.self, forKey: .data)
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,3 @@ struct GenericResponse<T: Decodable>: Decodable {
self.data = try container.decodeIfPresent(T.self, forKey: .data)
}
}

struct VoidResult: Decodable {

}

struct ErrorResponse: Decodable {
var statusCode: Int
var message: String
var data: String?

enum CodingKeys: CodingKey {
case statusCode
case message
case data
}

init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.statusCode = (try? container.decode(Int.self, forKey: .statusCode)) ?? 500
self.message = (try? container.decode(String.self, forKey: .message)) ?? ""
self.data = try container.decodeIfPresent(String.self, forKey: .data)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
//

import Foundation

struct VoidResult: Decodable {}

0 comments on commit d96dfd7

Please sign in to comment.