-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
24 changed files
with
1,447 additions
and
247 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
17 changes: 17 additions & 0 deletions
17
...tDrop/StreetDrop/Data/Repositories/Protocol/RecommendMusic/RecommendMusicRepository.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,17 @@ | ||
// | ||
// RecommendMusicRepository.swift | ||
// StreetDrop | ||
// | ||
// Created by jihye kim on 07/08/2024. | ||
// | ||
|
||
import Foundation | ||
|
||
import RxSwift | ||
|
||
protocol RecommendMusicRepository { | ||
func fetchPromptOfTheDay() -> Single<String> | ||
func fetchTrendingMusicList() -> Single<[Music]> | ||
func fetchMostDroppedMusicList() -> Single<[Music]> | ||
func fetchArtistList() -> Single<[Artist]> | ||
} |
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
67 changes: 67 additions & 0 deletions
67
StreetDrop/StreetDrop/Data/Repositories/RecommendMusic/DefaultRecommendMusicRepository.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,67 @@ | ||
// | ||
// DefaultRecommendMusicRepository.swift | ||
// StreetDrop | ||
// | ||
// Created by jihye kim on 07/08/2024. | ||
// | ||
|
||
import Foundation | ||
|
||
import Moya | ||
import RxSwift | ||
|
||
final class DefaultRecommendMusicRepository: RecommendMusicRepository { | ||
private let networkManager: NetworkManager | ||
|
||
init( | ||
networkManager: NetworkManager = NetworkManager( | ||
provider: MoyaProvider<MultiTarget>() | ||
) | ||
) { | ||
self.networkManager = networkManager | ||
} | ||
|
||
// TODO: jihye - update api | ||
|
||
func fetchPromptOfTheDay() -> Single<String> { | ||
Single.just("비오는 날, 어떤 음악이 떠오르시나요?") | ||
} | ||
|
||
func fetchTrendingMusicList() -> Single<[Music]> { | ||
Single.just([ | ||
Music( | ||
albumName: "", | ||
artistName: "ILLIT", | ||
songName: "Magnetic", | ||
durationTime: "2:41", | ||
albumImage: "https://is2-ssl.mzstatic.com/image/thumb/Music126/v4/03/8d/0e/038d0e52-e96d-f386-b8eb-9f77fa013543/195497146918_Cover.jpg/300x300bb.jpg", | ||
albumThumbnailImage: "https://is2-ssl.mzstatic.com/image/thumb/Music126/v4/03/8d/0e/038d0e52-e96d-f386-b8eb-9f77fa013543/195497146918_Cover.jpg/100x100bb.jpg", | ||
genre: [] | ||
) | ||
]) | ||
} | ||
|
||
func fetchMostDroppedMusicList() -> Single<[Music]> { | ||
Single.just([ | ||
Music( | ||
albumName: "", | ||
artistName: "NewJeans", | ||
songName: "Supernatural", | ||
durationTime: "3:11", | ||
albumImage: "https://is2-ssl.mzstatic.com/image/thumb/Music126/v4/03/8d/0e/038d0e52-e96d-f386-b8eb-9f77fa013543/195497146918_Cover.jpg/300x300bb.jpg", | ||
albumThumbnailImage: "https://is2-ssl.mzstatic.com/image/thumb/Music126/v4/03/8d/0e/038d0e52-e96d-f386-b8eb-9f77fa013543/195497146918_Cover.jpg/100x100bb.jpg", | ||
genre: [] | ||
) | ||
]) | ||
} | ||
|
||
func fetchArtistList() -> Single<[Artist]> { | ||
return Single.just([ | ||
Artist(name: "NewJeans", image: "https://is2-ssl.mzstatic.com/image/thumb/Music126/v4/03/8d/0e/038d0e52-e96d-f386-b8eb-9f77fa013543/195497146918_Cover.jpg/100x100bb.jpg"), | ||
Artist(name: "SEVENTEEN", image: "https://is2-ssl.mzstatic.com/image/thumb/Music126/v4/03/8d/0e/038d0e52-e96d-f386-b8eb-9f77fa013543/195497146918_Cover.jpg/100x100bb.jpg"), | ||
Artist(name: "아이유", image: "https://is2-ssl.mzstatic.com/image/thumb/Music126/v4/03/8d/0e/038d0e52-e96d-f386-b8eb-9f77fa013543/195497146918_Cover.jpg/100x100bb.jpg"), | ||
Artist(name: "aespa", image: "https://is2-ssl.mzstatic.com/image/thumb/Music126/v4/03/8d/0e/038d0e52-e96d-f386-b8eb-9f77fa013543/195497146918_Cover.jpg/100x100bb.jpg"), | ||
Artist(name: "최유리", image: "https://is2-ssl.mzstatic.com/image/thumb/Music126/v4/03/8d/0e/038d0e52-e96d-f386-b8eb-9f77fa013543/195497146918_Cover.jpg/100x100bb.jpg") | ||
]) | ||
} | ||
} |
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
41 changes: 41 additions & 0 deletions
41
StreetDrop/StreetDrop/Domain/UseCase/RecommendMusicUsecase.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,41 @@ | ||
// | ||
// RecommendMusicUsecase.swift | ||
// StreetDrop | ||
// | ||
// Created by jihye kim on 07/08/2024. | ||
// | ||
|
||
import Foundation | ||
|
||
import RxSwift | ||
|
||
protocol RecommendMusicUsecase { | ||
func getPromptOfTheDay() -> Single<String> | ||
func getTrendingMusicList() -> Single<[Music]> | ||
func getMostDroppedMusicList() -> Single<[Music]> | ||
func getArtistList() -> Single<[Artist]> | ||
} | ||
|
||
final class DefaultRecommendMusicUsecase: RecommendMusicUsecase { | ||
private let recommendMusicRepository: RecommendMusicRepository | ||
|
||
init(recommendMusicRepository: RecommendMusicRepository = DefaultRecommendMusicRepository()) { | ||
self.recommendMusicRepository = recommendMusicRepository | ||
} | ||
|
||
func getPromptOfTheDay() -> Single<String> { | ||
recommendMusicRepository.fetchPromptOfTheDay() | ||
} | ||
|
||
func getTrendingMusicList() -> Single<[Music]> { | ||
recommendMusicRepository.fetchTrendingMusicList() | ||
} | ||
|
||
func getMostDroppedMusicList() -> Single<[Music]> { | ||
recommendMusicRepository.fetchMostDroppedMusicList() | ||
} | ||
|
||
func getArtistList() -> Single<[Artist]> { | ||
recommendMusicRepository.fetchArtistList() | ||
} | ||
} |
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
71 changes: 0 additions & 71 deletions
71
StreetDrop/StreetDrop/Presentation/SearchingMusicScene/View/RecentQueryButton.swift
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.