Skip to content

Commit

Permalink
✨ :: [#438] LikeDomain 모듈 작업 완료 및 레거시 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
KangTaeHoon committed Mar 10, 2024
1 parent 4d48e6b commit 3a79c0e
Show file tree
Hide file tree
Showing 25 changed files with 79 additions and 62 deletions.
3 changes: 2 additions & 1 deletion Projects/App/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ let targets: [Target] = [
.domain(target: .ArtistDomain),
.domain(target: .AuthDomain),
.domain(target: .ChartDomain),
.domain(target: .FaqDomain)
.domain(target: .FaqDomain),
.domain(target: .LikeDomain)
],
settings: .settings(
base: env.baseSetting,
Expand Down
5 changes: 2 additions & 3 deletions Projects/App/Sources/Application/AppComponent+Like.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
//

import CommonFeature
import DataModule
import DomainModule
import NetworkModule
import SignInFeature
import StorageFeature
import LikeDomain
import LikeDomainInterface

// MARK: 변수명 주의
// AppComponent 내 변수 == Dependency 내 변수 이름 같아야함
Expand Down
2 changes: 2 additions & 0 deletions Projects/App/Sources/Application/NeedleGenerated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import FaqDomainInterface
import Foundation
import HomeFeature
import KeychainModule
import LikeDomain
import LikeDomainInterface
import MainTabFeature
import NeedleFoundation
import NetworkModule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
// Copyright © 2023 yongbeomkwak. All rights reserved.
//

import DataMappingModule
import DomainModule
import ErrorModule
import Foundation
import RxSwift

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
// Copyright © 2023 yongbeomkwak. All rights reserved.
//

import DataMappingModule
import ErrorModule
import Foundation
import RxSwift

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// Copyright © 2023 yongbeomkwak. All rights reserved.
//

import DataMappingModule
import Foundation
import RxSwift

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// Copyright © 2023 yongbeomkwak. All rights reserved.
//

import DataMappingModule
import Foundation
import RxSwift

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// Copyright © 2023 yongbeomkwak. All rights reserved.
//

import DataMappingModule
import Foundation
import RxSwift

Expand Down
21 changes: 21 additions & 0 deletions Projects/Domains/LikeDomain/Project.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import DependencyPlugin
import ProjectDescription
import ProjectDescriptionHelpers

let project = Project.module(
name: ModulePaths.Domain.LikeDomain.rawValue,
targets: [
.interface(module: .domain(.LikeDomain)),
.implements(
module: .domain(.LikeDomain),
dependencies: [
.domain(target: .BaseDomain),
.domain(target: .LikeDomain, type: .interface)
]
),
.tests(
module: .domain(.LikeDomain),
dependencies: [.domain(target: .LikeDomain)]
)
]
)
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import DataMappingModule
import ErrorModule
import Foundation
import KeychainModule
import Moya
import BaseDomain

public enum LikeAPI {
case fetchLikeNumOfSong(id: String)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import APIKit
import DataMappingModule
import DomainModule
import ErrorModule
import Foundation
import RxSwift
import BaseDomain
import LikeDomainInterface

public final class RemoteLikeDataSourceImpl: BaseRemoteDataSource<LikeAPI>, RemoteLikeDataSource {
public func fetchLikeNumOfSong(id: String) -> Single<LikeEntity> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@
// Copyright © 2023 yongbeomkwak. All rights reserved.
//

import DatabaseModule
import DataMappingModule
import DomainModule
import ErrorModule
import NetworkModule
import LikeDomainInterface
import RxSwift

public struct LikeRepositoryImpl: LikeRepository {
public final class LikeRepositoryImpl: LikeRepository {
private let remoteLikeDataSource: any RemoteLikeDataSource

public init(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@
//

import Foundation
import LikeDomainInterface

public struct FetchLikeResponseDTO: Codable {
public struct FetchLikeResponseDTO: Decodable {
public let songId: String
public let like: Int
}

public extension FetchLikeResponseDTO {
func toDomain() -> LikeEntity {
LikeEntity(status: 200, likes: like)
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
//
// FetchLikeTransfer.swift
// NetworkModuleTests
// LikeResponseDTO.swift
// DataMappingModuleTests
//
// Created by YoungK on 2023/04/03.
// Copyright © 2023 yongbeomkwak. All rights reserved.
//

import DataMappingModule
import DomainModule
import Foundation
import Utility
import LikeDomainInterface

public struct LikeResponseDTO: Decodable {
public let status: Int?
public let like: Int
}

public extension LikeResponseDTO {
func toDomain() -> LikeEntity {
Expand All @@ -19,9 +22,3 @@ public extension LikeResponseDTO {
)
}
}

public extension FetchLikeResponseDTO {
func toDomain() -> LikeEntity {
LikeEntity(status: 200, likes: like)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
// Copyright © 2023 yongbeomkwak. All rights reserved.
//

import DataMappingModule
import DomainModule
import ErrorModule
import Foundation
import RxSwift
import LikeDomainInterface

public struct AddLikeSongUseCaseImpl: AddLikeSongUseCase {
private let likeRepository: any LikeRepository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
// Copyright © 2023 yongbeomkwak. All rights reserved.
//

import DataMappingModule
import DomainModule
import ErrorModule
import LikeDomainInterface
import Foundation
import RxSwift

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
// Copyright © 2023 yongbeomkwak. All rights reserved.
//

import DataMappingModule
import DomainModule
import ErrorModule
import LikeDomainInterface
import Foundation
import RxSwift

Expand Down
11 changes: 11 additions & 0 deletions Projects/Domains/LikeDomain/Tests/LikeDomainTest.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import XCTest

final class LikeDomainTests: XCTestCase {
override func setUpWithError() throws {}

override func tearDownWithError() throws {}

func testExample() {
XCTAssertEqual(1, 1)
}
}
19 changes: 14 additions & 5 deletions Projects/Features/PlayerFeature/Project.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
import DependencyPlugin
import ProjectDescription
import ProjectDescriptionHelpers

let project = Project.makeModule(
name: "PlayerFeature",
product: .staticFramework,
dependencies: [
.Project.Features.CommonFeature
let project = Project.module(
name: ModulePaths.Feature.PlayerFeature.rawValue,
targets: [
.implements(
module: .feature(.PlayerFeature),
product: .staticFramework,
spec: .init(
dependencies: [
.feature(target: .CommonFeature),
.domain(target: .LikeDomain, type: .interface)
]
)
)
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import CommonFeature
import DomainModule
import Foundation
import NeedleFoundation
import LikeDomainInterface

public protocol PlayerDependency: Dependency {
var fetchLyricsUseCase: any FetchLyricsUseCase { get }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import DomainModule
import Foundation
import RxSwift
import Utility
import LikeDomainInterface

// MARK: - 뷰모델 내 API를 사용하는 함수들을 모아놓은 곳입니다.
extension PlayerViewModel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import RxCocoa
import RxSwift
import Utility
import YouTubePlayerKit
import LikeDomainInterface

final class PlayerViewModel: ViewModelType {
struct Input {
Expand Down

This file was deleted.

Binary file modified graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3a79c0e

Please sign in to comment.