Skip to content

Commit ac55dc5

Browse files
committed
🧩 :: NotificationsDataSource
1 parent 5a96f53 commit ac55dc5

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import RxSwift
2+
import RxCocoa
3+
import Domain
4+
5+
public protocol RemoteNotificationsDataSource {
6+
func fetchNotificationList() -> Single<[NotificationEntity]>
7+
func patchReadNotification(id: Int) -> Completable
8+
}
9+
10+
final class RemoteNotificationsDataSourceImpl: RemoteBaseDataSource<NotificationsAPI>, RemoteNotificationsDataSource {
11+
public func fetchNotificationList() -> Single<[NotificationEntity]> {
12+
request(.fetchNotificationList)
13+
.map(NotificationListResponseDTO.self)
14+
.map { $0.toDomain() }
15+
}
16+
17+
public func patchReadNotification(id: Int) -> Completable {
18+
request(.patchReadNotification(id: id))
19+
.asCompletable()
20+
}
21+
}

0 commit comments

Comments
 (0)