-
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] 명언 API 구현 및 인터랙터 분리
- Loading branch information
Showing
12 changed files
with
131 additions
and
33 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
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
23 changes: 23 additions & 0 deletions
23
HongikYeolgong2/Domain/Entities/WeeklyStudy/WiseSaying.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,23 @@ | ||
// | ||
// WiseSaying.swift | ||
// HongikYeolgong2 | ||
// | ||
// Created by 권석기 on 10/28/24. | ||
// | ||
|
||
import Foundation | ||
|
||
struct WiseSaying: Decodable { | ||
var quote: String | ||
let author: String | ||
|
||
init(quote: String, author: String) { | ||
self.quote = quote | ||
self.author = author | ||
} | ||
|
||
init() { | ||
self.quote = "행동보다 빠르게 불안감을 \n 없앨 수 있는 것은 없습니다." | ||
self.author = "윌터 앤더슨" | ||
} | ||
} |
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
45 changes: 45 additions & 0 deletions
45
HongikYeolgong2/Domain/Interactors/WeeklyStudyInteractor.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,45 @@ | ||
// | ||
// WeeklyStudyInteractor.swift | ||
// HongikYeolgong2 | ||
// | ||
// Created by 권석기 on 10/28/24. | ||
// | ||
|
||
import SwiftUI | ||
|
||
protocol WeeklyStudyInteractor { | ||
func getWeekyStudy(studyRecords: Binding<[WeeklyStudyRecord]>) | ||
func getWiseSaying(wiseSaying: Binding<WiseSaying>) | ||
} | ||
|
||
final class WeeklyStudyInteractorImpl: WeeklyStudyInteractor { | ||
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 getWeekyStudy(studyRecords: Binding<[WeeklyStudyRecord]>) { | ||
studySessionRepository | ||
.getWeeklyStudyRecords() | ||
.receive(on: DispatchQueue.main) | ||
.sink(receiveCompletion: { _ in }) { | ||
studyRecords.wrappedValue = $0 | ||
} | ||
.store(in: cancleBag) | ||
} | ||
|
||
func getWiseSaying(wiseSaying: Binding<WiseSaying>) { | ||
studySessionRepository | ||
.getWiseSaying() | ||
.sink { _ in | ||
} receiveValue: { | ||
wiseSaying.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
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
Binary file modified
BIN
-28.1 KB
(79%)
HongikYeolgong2/Resources/Assets.xcassets/AppIcon.appiconset/appstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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