-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feat] #470 - 메인 문구 조회 API 데이터 레이어 구현
- Loading branch information
1 parent
4779522
commit b0ffdde
Showing
4 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
SOPT-iOS/Projects/Data/Sources/Repository/HomeRepository.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,28 @@ | ||
// | ||
// HomeRepository.swift | ||
// Data | ||
// | ||
// Created by Jae Hyun Lee on 1/14/25. | ||
// Copyright © 2025 SOPT-iOS. All rights reserved. | ||
// | ||
|
||
import Combine | ||
|
||
import Core | ||
import Domain | ||
import Networks | ||
|
||
public class HomeRepository { | ||
|
||
private let homeService: HomeService | ||
|
||
private let cancelBag = CancelBag() | ||
|
||
public init(homeService: HomeService) { | ||
self.homeService = homeService | ||
} | ||
} | ||
|
||
extension HomeRepository: HomeRepositoryInterface { | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
SOPT-iOS/Projects/Data/Sources/Transform/HomeDescriptionTransform.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 @@ | ||
// | ||
// HomeDescriptionTransform.swift | ||
// Data | ||
// | ||
// Created by Jae Hyun Lee on 1/14/25. | ||
// Copyright © 2025 SOPT-iOS. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
import Domain | ||
import Networks | ||
|
||
extension HomeDescriptionEntity { | ||
public func toDomain() -> HomeDescriptionModel { | ||
return HomeDescriptionModel.init(description: activityDescription) | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
SOPT-iOS/Projects/Domain/Sources/Model/HomeDescriptionModel.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,25 @@ | ||
// | ||
// HomeDescriptionModel.swift | ||
// Domain | ||
// | ||
// Created by Jae Hyun Lee on 1/14/25. | ||
// Copyright © 2025 SOPT-iOS. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
import Core | ||
|
||
public struct HomeDescriptionModel { | ||
public let description: String | ||
|
||
public init(description: String) { | ||
self.description = description | ||
} | ||
} | ||
|
||
extension HomeDescriptionModel { | ||
public static var defaultDescription: Self { | ||
return HomeDescriptionModel(description: I18N.Home.DashBoard.UserHistory.encourage) | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
SOPT-iOS/Projects/Domain/Sources/RepositoryInterface/HomeRepositoryInterface.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 @@ | ||
// | ||
// HomeRepositoryInterface.swift | ||
// Domain | ||
// | ||
// Created by Jae Hyun Lee on 1/14/25. | ||
// Copyright © 2025 SOPT-iOS. All rights reserved. | ||
// | ||
|
||
import Combine | ||
|
||
import Core | ||
|
||
public protocol HomeRepositoryInterface { | ||
func getHomeDescription() -> AnyPublisher<HomeDescriptionModel, Error> | ||
} |