-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFollowRepository.swift
More file actions
41 lines (34 loc) · 1.02 KB
/
FollowRepository.swift
File metadata and controls
41 lines (34 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// FollowRepository.swift
// Data
//
// Created by kimnahun on 2026-01-23.
// Copyright © 2026 NDGL-iOS. All rights reserved.
//
import Domain
import Foundation
import Networks
public final class FollowRepository: FollowRepositoryProtocol, @unchecked Sendable {
private let service: FollowServiceProtocol
public init(service: FollowServiceProtocol) {
self.service = service
}
public func fetchTravelDetail(id: Int) async -> TravelDetail? {
let result = await service.getContentCard(id: id)
switch result {
case .success(let response):
return response.toDomain()
case .failure, .networkFailure:
return nil
}
}
public func fetchPlaces(travelId: Int, day: Int) async -> [TravelPlace] {
let result = await service.getItinerary(id: travelId, day: day)
switch result {
case .success(let response):
return response.toDomain()
case .failure, .networkFailure:
return []
}
}
}