Skip to content

Commit

Permalink
[Feat] #470 - 메인 문구 조회 API 데이터 레이어 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
dlwogus0128 committed Jan 14, 2025
1 parent 4779522 commit b0ffdde
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 0 deletions.
28 changes: 28 additions & 0 deletions SOPT-iOS/Projects/Data/Sources/Repository/HomeRepository.swift
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 {

}
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 SOPT-iOS/Projects/Domain/Sources/Model/HomeDescriptionModel.swift
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)
}
}
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>
}

0 comments on commit b0ffdde

Please sign in to comment.