Skip to content

Commit d87c0a4

Browse files
authored
[Fix] #787 - 솝트로그 응답값 매핑 수정
[Fix] #787 - 솝트로그 응답값 매핑 수정
2 parents f2e3727 + ab7557a commit d87c0a4

File tree

5 files changed

+16
-12
lines changed

5 files changed

+16
-12
lines changed

SOPT-iOS/Projects/Domain/Sources/Model/SoptlogModel.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ public struct SoptlogModel {
1616
public let todayFortuneText: String
1717

1818
/// 솝탬프 정보
19-
public let soptampCount: Int
20-
public let viewCount: Int
21-
public let myClapCount: Int
19+
public let soptampCount: Int?
20+
public let viewCount: Int?
21+
public let myClapCount: Int?
2222

2323
/// 콕찌르기 정보
2424
public let totalPokeCount: Int
@@ -30,9 +30,9 @@ public struct SoptlogModel {
3030
isActive: Bool,
3131
isFortuneChecked: Bool,
3232
todayFortuneText: String,
33-
soptampCount: Int,
34-
viewCount: Int,
35-
myClapCount: Int,
33+
soptampCount: Int?,
34+
viewCount: Int?,
35+
myClapCount: Int?,
3636
totalPokeCount: Int,
3737
newFriendsPokeCount: Int,
3838
bestFriendsPokeCount: Int,

SOPT-iOS/Projects/Features/SoptlogFeature/Sources/SoptlogScene/Model/SoptlogPresentationModel.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ extension SoptlogModel {
2727
let soptampMenus: [SoptlogMenuModel] = [
2828
SoptlogMenuModel(
2929
title: I18N.Soptlog.Menu.completedMission,
30-
value: "\(soptampCount)",
30+
value: "\(soptampCount ?? 0)",
3131
hasTooltip: false,
3232
hasChevron: true
3333
),
3434
SoptlogMenuModel(
3535
title: I18N.Soptlog.Menu.views,
36-
value: "\(viewCount)",
36+
value: "\(viewCount ?? 0)",
3737
hasTooltip: true,
3838
hasChevron: false
3939
),
4040
SoptlogMenuModel(
4141
title: I18N.Soptlog.Menu.receivedClapCount,
42-
value: "\(myClapCount)",
42+
value: "\(myClapCount ?? 0)",
4343
hasTooltip: false,
4444
hasChevron: false
4545
)

SOPT-iOS/Projects/Features/SoptlogFeature/Sources/SoptlogScene/ViewModel/SoptlogViewModel.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ extension SoptlogViewModel {
132132
} catch let error as MainError {
133133
switch error {
134134
case .networkError(_):
135+
#warning("AlertVC가 메인스레드에서 보여지지 않는 문제 발생. #789에서 해결 필요")
136+
print("🚨 네트워크 에러")
135137
onNetworkError?()
136138
case .authFailed:
137139
print("🚨 SoptlogViewModel: 인증에 실패했습니다.")

SOPT-iOS/Projects/Modules/Networks/Sources/Entity/ResponseEntity/SoptlogResponseEntity.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ public struct SoptlogResponseEntity: Decodable {
1616
public let todayFortuneText: String
1717

1818
/// 솝탬프 정보
19-
public let soptampCount: Int
20-
public let viewCount: Int
21-
public let myClapCount: Int
19+
public let soptampCount: Int?
20+
public let viewCount: Int?
21+
public let myClapCount: Int?
2222

2323
/// 콕찌르기 정보
2424
public let totalPokeCount: Int

SOPT-iOS/Projects/Modules/Networks/Sources/Foundation/BaseService.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,10 @@ extension BaseService {
302302
continuation.resume(returning: body)
303303
} catch let error {
304304
if let error = error as? APIError {
305+
print("🚨 APIError 발생: \(error.localizedDescription)")
305306
continuation.resume(throwing: error)
306307
}
308+
print("🚨 정의되지 않은 에러 발생: \(error.localizedDescription)")
307309
continuation.resume(throwing: MoyaError.jsonMapping(value))
308310
}
309311
case .failure(let error):

0 commit comments

Comments
 (0)