feat: 定义仓库协议与用例(含会话)
This commit is contained in:
14
IosClientKit/Sources/CoreDomain/ProfileUseCase.swift
Normal file
14
IosClientKit/Sources/CoreDomain/ProfileUseCase.swift
Normal file
@@ -0,0 +1,14 @@
|
||||
import CoreModel
|
||||
|
||||
/// 获取个人资料的用例。
|
||||
public struct ProfileUseCase: Sendable {
|
||||
private let repository: ProfileRepository
|
||||
|
||||
public init(repository: ProfileRepository) {
|
||||
self.repository = repository
|
||||
}
|
||||
|
||||
public func observeProfile() -> AsyncThrowingStream<UserProfile, Error> {
|
||||
repository.observeProfile()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user