Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ”€ :: (#511) v3.0 api 변경점 적용 - Artist Domain #539

Merged
merged 25 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e0488f8
πŸ‘½οΈ :: [#511] v3.0 api 변경사항 반영
KangTaeHoon May 13, 2024
50bb4a6
♻️ :: [#511] DTO > Public 제거
KangTaeHoon May 13, 2024
8a5ea38
♻️ :: [#511] NeedleGenerated
KangTaeHoon May 13, 2024
af7898e
♻️ :: [#511] 컀밋 ν• λ•Œλ§ˆλ‹€ λ‚˜νƒ€λ‚˜λŠ” 변경점
KangTaeHoon May 13, 2024
37523e4
πŸ‘½οΈ :: [#512] v3.0 api 변경사항 반영
KangTaeHoon May 13, 2024
067af09
♻️ :: [#512] λ©μ²­ν•œ μ—‘μŠ€μ½”λ“œλ‘œ μΈν•œ μˆ˜μ •
KangTaeHoon May 13, 2024
0b60c32
♻️ :: [#512] 린트 κ²½κ³  제거
KangTaeHoon May 13, 2024
ddc83f2
♻️ :: [#507] SingleSongResponseDTO
KangTaeHoon May 13, 2024
698b928
♻️ :: [#507] LyricsResponseDTO, LyricsEntity
KangTaeHoon May 13, 2024
3099fea
♻️ :: [#511] ArtistReactorTests
KangTaeHoon May 13, 2024
5322f05
Merge branch '511-update-domain-artist' into 507-update-domain-song
KangTaeHoon May 13, 2024
154da0c
Merge branch '511-update-domain-artist' into 512-update-domain-chart
KangTaeHoon May 13, 2024
e8a1b2c
✏️ :: [#507] SongCreditsResponseDTO, SongCreditsEntity,
KangTaeHoon May 13, 2024
1f4d2d0
✏️ :: [#507] FetchSongCreditsUseCase
KangTaeHoon May 13, 2024
fbb06d0
♻️ :: [#507] 린트 κ²½κ³  제거
KangTaeHoon May 13, 2024
c548473
πŸ”₯ :: [#507] FetchSearchSongUseCase
KangTaeHoon May 13, 2024
103b046
♻️ :: [#507] μ˜΅μ…”λ„ 제거, 넀이밍 μˆ˜μ • λ“±
KangTaeHoon May 14, 2024
e29f689
♻️ :: [#507] idκ°’μœΌλ‘œ name.kr μ‚¬μš©
KangTaeHoon May 14, 2024
5190c53
♻️ :: [#507] ArtistReactorTests
KangTaeHoon May 14, 2024
e8d62b2
Merge branch '512-update-domain-chart' into 507-update-domain-song
KangTaeHoon May 15, 2024
7719a76
Merge pull request #541 from wakmusic/507-update-domain-song
KangTaeHoon May 15, 2024
9f41d37
Merge pull request #540 from wakmusic/512-update-domain-chart
KangTaeHoon May 15, 2024
1b31e80
♻️ :: [#511] ArtistListResponseDTO
KangTaeHoon May 15, 2024
b4b68bc
♻️ :: [#511] ArtistListResponseDTO
KangTaeHoon May 15, 2024
a7a0a43
Merge branch 'develop' into 511-update-domain-artist
KangTaeHoon May 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions Projects/App/Sources/Application/AppComponent+Songs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ public extension AppComponent {
}
}

var fetchSearchSongUseCase: any FetchSearchSongUseCase {
shared {
FetchSearchSongUseCaseImpl(songsRepository: songsRepository)
}
}

var fetchLyricsUseCase: any FetchLyricsUseCase {
shared {
FetchLyricsUseCaseImpl(songsRepository: songsRepository)
Expand Down
191 changes: 93 additions & 98 deletions Projects/App/Sources/Application/NeedleGenerated.swift

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,46 +10,39 @@ import Foundation

public struct ArtistListEntity: Equatable {
public init(
artistId: String,
name: String,
short: String,
group: String,
id: String,
krName: String,
enName: String,
groupName: String,
title: String,
description: String,
color: [[String]],
youtube: String,
twitch: String,
instagram: String,
imageRoundVersion: Int,
imageSquareVersion: Int,
personalColor: String,
roundImage: String,
squareImage: String,
graduated: Bool,
isHiddenItem: Bool
) {
self.artistId = artistId
self.name = name
self.short = short
self.group = group
self.id = id
self.krName = krName
self.enName = enName
self.groupName = groupName
self.title = title
self.description = description
self.color = color
self.youtube = youtube
self.twitch = twitch
self.instagram = instagram
self.imageRoundVersion = imageRoundVersion
self.imageSquareVersion = imageSquareVersion
self.personalColor = personalColor
self.roundImage = roundImage
self.squareImage = squareImage
self.graduated = graduated
self.isHiddenItem = isHiddenItem
}

public static func == (lhs: Self, rhs: Self) -> Bool {
return lhs.artistId == rhs.artistId
return lhs.id == rhs.id
}

public let artistId, name, short, group: String
public let id, krName, enName, groupName: String
public let title, description: String
public let color: [[String]]
public let youtube, twitch, instagram: String
public let imageRoundVersion, imageSquareVersion: Int
public let personalColor: String
public let roundImage, squareImage: String
public let graduated: Bool
public var isHiddenItem: Bool = false
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,23 @@ import Foundation

public struct ArtistSongListEntity: Equatable {
public init(
songId: String,
songID: String,
title: String,
artist: String,
remix: String,
reaction: String,
date: String,
views: Int,
last: Int,
isSelected: Bool
) {
self.songId = songId
self.songID = songID
self.title = title
self.artist = artist
self.remix = remix
self.reaction = reaction
self.date = date
self.views = views
self.last = last
self.isSelected = isSelected
}

public static func == (lhs: Self, rhs: Self) -> Bool {
return lhs.songId == rhs.songId
return lhs.songID == rhs.songID
}

public let songId, title, artist, remix, reaction, date: String
public let views, last: Int
public let songID, title, artist, date: String
public var isSelected: Bool = false
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

import Foundation

public enum ArtistSongSortType: String {
case new
public enum ArtistSongSortType: Int {
case new = 1
case popular
case old

Expand Down
13 changes: 6 additions & 7 deletions Projects/Domains/ArtistDomain/Sources/API/ArtistAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ extension ArtistAPI: WMAPI {
public var urlPath: String {
switch self {
case .fetchArtistList:
return ""
case .fetchArtistSongList:
return "/albums"
return "/list"
case let .fetchArtistSongList(id, _, _):
return "/\(id)/songs"
}
}

Expand All @@ -47,12 +47,11 @@ extension ArtistAPI: WMAPI {
switch self {
case .fetchArtistList:
return .requestPlain
case let .fetchArtistSongList(id, sort, page):
case let .fetchArtistSongList(_, sort, page):
return .requestParameters(
parameters: [
"id": id,
"sort": sort.rawValue,
"start": (page == 1) ? 0 : (page - 1) * 30
"type": sort.rawValue,
"page": page
],
encoding: URLEncoding.queryString
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,72 +10,77 @@ import ArtistDomainInterface
import Foundation

public struct ArtistListResponseDTO: Decodable, Equatable {
public let artistId, name, short: String
public let description: String
public let title: ArtistListResponseDTO.Title?
public let color: ArtistListResponseDTO.Color?
public let youtube, twitch, instagram: String?
public let graduated: Bool?
public let group: ArtistListResponseDTO.Group?
public let image: ArtistListResponseDTO.Image?
let name: ArtistListResponseDTO.Name
let group: ArtistListResponseDTO.Group
let info: ArtistListResponseDTO.Info
let imageURL: ArtistListResponseDTO.ImageURL
let graduated: Bool

public static func == (lhs: Self, rhs: Self) -> Bool {
return lhs.artistId == rhs.artistId
return lhs.name.id == rhs.name.id
}

private enum CodingKeys: String, CodingKey {
case artistId
case title
case group, image
case name, short, description
case color, youtube, twitch, instagram
case name
case group
case info
case imageURL = "imageUrl"
case graduated
}
}

public extension ArtistListResponseDTO {
struct Group: Codable {
public let engName: String
public let korName: String
struct Name: Decodable {
let id: String
let krName: String
let enName: String

private enum CodingKeys: String, CodingKey {
case engName = "en"
case korName = "kr"
case id = "kr"
case krName = "krShort"
case enName = "en"
}
}

struct Image: Codable {
public let round: Int
public let square: Int
struct Group: Decodable {
let name: String
}

// MARK: - Color
struct Color: Codable {
public let background: [[String]]
struct Info: Decodable {
let title: ArtistListResponseDTO.Info.Title
let description: String
let color: ArtistListResponseDTO.Info.Color
}

// MARK: - Title
struct Title: Codable {
public let app: String
struct ImageURL: Decodable {
let round: String
let square: String
}
}

public extension ArtistListResponseDTO.Info {
struct Title: Decodable {
let short: String
}

struct Color: Decodable {
let background: [[String]]
}
}

public extension ArtistListResponseDTO {
func toDomain() -> ArtistListEntity {
ArtistListEntity(
artistId: artistId,
name: name,
short: short,
group: group?.korName ?? "",
title: title?.app ?? "",
description: description,
color: color?.background ?? [],
youtube: youtube ?? "",
twitch: twitch ?? "",
instagram: instagram ?? "",
imageRoundVersion: image?.round ?? 0,
imageSquareVersion: image?.square ?? 0,
graduated: graduated ?? false,
id: name.id,
krName: name.krName,
enName: name.enName,
groupName: group.name,
title: info.title.short,
description: info.description,
personalColor: info.color.background.flatMap { $0 }.first ?? "ffffff",
roundImage: imageURL.round,
squareImage: imageURL.square,
graduated: graduated,
isHiddenItem: false
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,27 @@ import Foundation
import Utility

public struct ArtistSongListResponseDTO: Decodable, Equatable {
public let songId, title, artist, remix: String
public let reaction: String
public let date: Int
public let total: ArtistSongListResponseDTO.Total?
let songID, title: String
let artists: [String]
let date: Int

public static func == (lhs: Self, rhs: Self) -> Bool {
return lhs.songId == rhs.songId
return lhs.songID == rhs.songID
}

enum CodingKeys: String, CodingKey {
case songId
case title, artist, remix, reaction, date, total
}
}

public extension ArtistSongListResponseDTO {
struct Total: Codable {
public let views: Int
public let last: Int
case songID = "videoId"
case title, artists, date
}
}

public extension ArtistSongListResponseDTO {
func toDomain() -> ArtistSongListEntity {
ArtistSongListEntity(
songId: songId,
songID: songID,
title: title,
artist: artist,
remix: remix,
reaction: reaction,
artist: artists.joined(separator: ", "),
date: date.changeDateFormat(origin: "yyMMdd", result: "yyyy.MM.dd"),
views: total?.views ?? 0,
last: total?.last ?? 0,
isSelected: false
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import Foundation
import RxSwift

public protocol RemoteChartDataSource {
func fetchChartRanking(type: ChartDateType, limit: Int) -> Single<[ChartRankingEntity]>
func fetchChartRanking(type: ChartDateType) -> Single<[ChartRankingEntity]>
func fetchChartUpdateTime(type: ChartDateType) -> Single<String>
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ public struct ChartRankingEntity: Equatable {
id: String,
title: String,
artist: String,
remix: String,
reaction: String,
views: Int,
last: Int,
increase: Int,
Expand All @@ -16,17 +14,14 @@ public struct ChartRankingEntity: Equatable {
self.id = id
self.title = title
self.artist = artist
self.remix = remix
self.reaction = reaction
self.views = views
self.last = last
self.increase = increase
self.date = date
self.isSelected = isSelected
}

public let id, title, artist, remix: String
public let reaction: String
public let id, title, artist: String
public let views, last, increase: Int
public let date: String
public var isSelected: Bool
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import Foundation

public enum ChartDateType: String {
case monthly
case weekly
case daily
case hourly
case daily
case weekly
case monthly
case total

public var display: String {
switch self {
case .monthly:
return "μ›”κ°„μˆœ"
case .weekly:
return "μ£Όκ°„μˆœ"
case .daily:
return "μΌκ°„μˆœ"
case .hourly:
return "μ‹œκ°„μˆœ"
case .daily:
return "μΌκ°„μˆœ"
case .weekly:
return "μ£Όκ°„μˆœ"
case .monthly:
return "μ›”κ°„μˆœ"
case .total:
return "λˆ„μ μˆœ"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import Foundation
import RxSwift

public protocol ChartRepository {
func fetchChartRanking(type: ChartDateType, limit: Int) -> Single<[ChartRankingEntity]>
func fetchChartRanking(type: ChartDateType) -> Single<[ChartRankingEntity]>
func fetchChartUpdateTime(type: ChartDateType) -> Single<String>
}
Loading
Loading