-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAuthRepository.swift
More file actions
38 lines (32 loc) · 951 Bytes
/
Copy pathAuthRepository.swift
File metadata and controls
38 lines (32 loc) · 951 Bytes
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
//
// AuthRepository.swift
// Data
//
// Created by kimnahun on 2026-02-18.
// Copyright © 2026 NDGL-iOS. All rights reserved.
//
import Foundation
import Domain
import Networks
public final class AuthRepository: AuthRepositoryInterface {
private let service: AuthServiceProtocol
public init(service: AuthServiceProtocol) {
self.service = service
}
public func signup(info: SignupInfo) async throws -> SignupResult {
do {
let request = SignupRequest(fcmToken: info.fcmToken)
return try await service.signup(request: request).toDomain()
} catch {
throw error.toNDGLError()
}
}
public func login(uuid: String) async throws -> LoginResult {
do {
let request = LoginRequest(uuid: uuid)
return try await service.login(request: request).toDomain()
} catch {
throw error.toNDGLError()
}
}
}