Skip to content

Commit

Permalink
feat #95: 데일리 문제 푼 사람 없을 경우 분기 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
0inn committed Sep 13, 2023
1 parent 80c02ec commit c77a6b5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Projects/Domain/Sources/Model/DailyStatisticsModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public struct DailyStatisticsModel: Equatable {

public struct TestsStatisticsModel: Hashable, Equatable {
public let keymeTests: KeymeTestsInfoModel
public let avarageScore: Double
public let avarageScore: Double?
}

public extension StatisticsDTO {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,19 @@ extension DailyTestListView {
font: .body3Semibold)
.foregroundColor(.white)

Text.keyme("평균점수 | \(testStatistics.avarageScore)",
font: .body4)
.foregroundColor(.white.opacity(0.5))
statisticsScoreText(score: testStatistics.avarageScore)
}
}
}
}
}
}
}

extension DailyTestListView {
func statisticsScoreText(score: Double?) -> some View {
Text.keyme(score != nil ? "평균점수 | \(String(describing: score))" : "아직 아무도 풀지 않았어요",
font: .body4)
.foregroundColor(.white.opacity(0.5))
}
}
2 changes: 0 additions & 2 deletions Projects/Features/Sources/Home/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public struct HomeView: View {
}

extension HomeView {
//
var startTestView: some View {
let startTestStore = store.scope(
state: \.$startTestState,
Expand All @@ -71,7 +70,6 @@ extension HomeView {
}
}

// 데일리
var dailyTestListView: some View {
let dailyTestListStore = store.scope(
state: \.$dailyTestListState,
Expand Down
7 changes: 4 additions & 3 deletions Projects/Network/Sources/DTO/StatisticsDTO.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ public struct StatisticsDTO: Codable {
public let data: StatisticsData

public struct StatisticsData: Codable {
public let averageRate: Int
public let averageRate: Int?
public let questionsStatistics: [QuestionsStatisticsData]
public let solvedCount: Int
}

public struct QuestionsStatisticsData: Codable {
public let category: Category
public let keyword, title: String
public let avgScore: Double
public let myScore, questionId: Int
public let avgScore: Double?
public let questionId: Int
public let myScore: Int?
}
}

0 comments on commit c77a6b5

Please sign in to comment.