-
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.
- Loading branch information
1 parent
c2fb4aa
commit ed64471
Showing
12 changed files
with
115 additions
and
73 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ import Combine | |
import Foundation | ||
import MusicKit | ||
|
||
import MSData | ||
import MSDomain | ||
import MSLogger | ||
|
||
|
File renamed without changes.
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
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
24 changes: 24 additions & 0 deletions
24
iOS/MSDomain/Sources/MSDomain/Repository/JourneyRepository.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,24 @@ | ||
// | ||
// JourneyRepository.swift | ||
// MSDomain | ||
// | ||
// Created by 이창준 on 2023.12.24. | ||
// | ||
|
||
import Foundation | ||
|
||
public protocol JourneyRepository { | ||
|
||
func fetchIsRecording() -> Bool | ||
mutating func updateIsRecording(_ isRecording: Bool) -> Bool | ||
func fetchRecordingJourneyID() -> String? | ||
func fetchRecordingJourney(forID id: String) -> RecordingJourney? | ||
func fetchJourneyList(userID: UUID, | ||
minCoordinate: Coordinate, | ||
maxCoordinate: Coordinate) async -> Result<[Journey], Error> | ||
mutating func startJourney(at coordinate: Coordinate, userID: UUID) async -> Result<RecordingJourney, Error> | ||
mutating func endJourney(_ journey: Journey) async -> Result<String, Error> | ||
func recordJourney(journeyID: String, at coordinates: [Coordinate]) async -> Result<RecordingJourney, Error> | ||
mutating func deleteJourney(_ journey: RecordingJourney, userID: UUID) async -> Result<String, Error> | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
iOS/MSDomain/Sources/MSDomain/Repository/Protocol/Persistable.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,16 @@ | ||
// | ||
// Persistable.swift | ||
// MSDomain | ||
// | ||
// Created by 이창준 on 2023.12.26. | ||
// | ||
|
||
import Foundation | ||
|
||
public protocol Persistable { | ||
|
||
@discardableResult | ||
func saveToLocal(_ value: Codable, at storage: MSPersistentStorage) -> Bool | ||
func loadJourney() -> RecordingJourney? | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
iOS/MSDomain/Sources/MSDomain/Repository/SongRepository.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,18 @@ | ||
// | ||
// SongRepository.swift | ||
// MSDomain | ||
// | ||
// Created by 이창준 on 2023.12.24. | ||
// | ||
|
||
import Foundation | ||
import MusicKit | ||
|
||
public protocol SongRepository { | ||
|
||
func fetchSong(withID id: String) async -> Result<Song, Error> | ||
func fetchSongList(with term: String) async -> Result<MusicItemCollection<Song>, Error> | ||
@available(iOS 16.0, *) | ||
func fetchSongListByRank() async -> Result<MusicItemCollection<Song>, Error> | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
iOS/MSDomain/Sources/MSDomain/Repository/SpotRepository.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,15 @@ | ||
// | ||
// SpotRepository.swift | ||
// MSDomain | ||
// | ||
// Created by 이창준 on 2023.12.24. | ||
// | ||
|
||
import Foundation | ||
|
||
public protocol SpotRepository { | ||
|
||
func fetchRecordingSpots() async -> Result<[Spot], Error> | ||
func upload(spot: Spot) async -> Result<Spot, Error> | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
iOS/MSDomain/Sources/MSDomain/Repository/UserRepository.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,16 @@ | ||
// | ||
// UserRepository.swift | ||
// MSDomain | ||
// | ||
// Created by 이창준 on 2023.12.24. | ||
// | ||
|
||
import Foundation | ||
|
||
public protocol UserRepository { | ||
|
||
func createUser() async -> Result<UUID, Error> | ||
func storeUUID(_ userID: UUID) throws -> UUID | ||
func fetchUUID() -> UUID? | ||
|
||
} |