Skip to content

Commit

Permalink
[Fix] TeamSparker#122 - 보관함, 인증사진 모아보기 데이터모델 수정
Browse files Browse the repository at this point in the history
보관함, 인증사진 모아보기 데이터모델 수정
  • Loading branch information
L-j-h-c committed Jan 19, 2022
1 parent 2347398 commit 01833fe
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 19 deletions.
8 changes: 0 additions & 8 deletions Spark-iOS/Spark-iOS/Source/NetworkModels/MyRoom/MyRoom.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ import Foundation

// MARK: - MyRoom
struct MyRoom: Codable {
let status: Int
let success: Bool
let message: String
let data: MyRoomData
}

// MARK: - DataClass
struct MyRoomData: Codable {
let nickname: String
let totalRoomNum, ongoingRoomNum, completeRoomNum, failRoomNum: Int
let rooms: [Rooms]?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,8 @@

import Foundation

// MARK: - MyRoomCerti
struct MyRoomCerti: Codable {
let status: Int
let success: Bool
let message: String
let data: MyRoomCertiData
}

// MARK: - MyRoomCertiData
struct MyRoomCertiData: Codable {
struct MyRoomCertification: Codable {
let roomName: String
let records: [CertiRecord]?
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public class MyRoomAPI {
private func judgeMyRoomCertiFetchStatus(by statusCode: Int, _ data: Data) -> NetworkResult<Any> {

let decoder = JSONDecoder()
guard let decodedData = try? decoder.decode(GenericResponse<MyRoomCertiData>.self, from: data)
guard let decodedData = try? decoder.decode(GenericResponse<MyRoomCertification>.self, from: data)
else {
return .pathErr
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ extension CompleteAuthVC {
MyRoomAPI.shared.myRoomCertiFetch(roomID: 2, lastID: -1, size: 7) { response in
switch response {
case .success(let data):
if let myRoomCerti = data as? MyRoomCerti {
if let myRoomCerti = data as? MyRoomCertification {
print(myRoomCerti)
}
case .requestErr(let message):
Expand Down

0 comments on commit 01833fe

Please sign in to comment.