-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[Feature] CalendarView 구현
- Loading branch information
Showing
40 changed files
with
621 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
HongikYeolgong2.xcodeproj/xcshareddata/xcschemes/HongikYeolgong2.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
HongikYeolgong2/Data/DTO/Calendar/CalendarCountAllResponseDTO.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
import Foundation | ||
|
||
struct CalendarCountAllResponseDTO: Decodable { | ||
let date: String | ||
let studyCount: Int | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
HongikYeolgong2/Domain/Entities/Calendar/AllStudyRecord.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
import Foundation | ||
|
||
struct AllStudyRecord { | ||
let day: String | ||
let month: String | ||
let year: String | ||
let date: Date | ||
let studyCount: Int | ||
} | ||
|
||
|
28 changes: 28 additions & 0 deletions
28
HongikYeolgong2/Domain/Interactors/CalendarDataInteractor.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
import SwiftUI | ||
|
||
protocol CalendarDataInteractor { | ||
func getAllStudy(studyRecords: Binding<[AllStudyRecord]>) | ||
} | ||
|
||
|
||
final class CalendarDataInteractorImpl: CalendarDataInteractor { | ||
private let appstate: Store<AppState> | ||
private let cancleBag = CancelBag() | ||
private let studySessionRepository: StudySessionRepository | ||
|
||
init(appstate: Store<AppState>, studySessionRepository: StudySessionRepository) { | ||
self.appstate = appstate | ||
self.studySessionRepository = studySessionRepository | ||
} | ||
|
||
func getAllStudy(studyRecords: Binding<[AllStudyRecord]>) { | ||
studySessionRepository | ||
.getAllStudyRecords() | ||
.receive(on: DispatchQueue.main) | ||
.sink(receiveCompletion: { _ in }) { | ||
studyRecords.wrappedValue = $0 | ||
} | ||
.store(in: cancleBag) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
import Foundation | ||
|
||
extension CalendarCountAllResponseDTO { | ||
func toEntity() -> AllStudyRecord { | ||
.init(day: date.toDayofDate(), month: date.toMonthofDate(), year: date.toYearofDate(), date: date.toDate() ?? Date.now, studyCount: studyCount) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.