24 lines
500 B
Swift
24 lines
500 B
Swift
//
|
|
// SettingAPI.swift
|
|
// suixinkan
|
|
//
|
|
|
|
import Foundation
|
|
|
|
@MainActor
|
|
/// 设置中心 API,封装版本检查等设置页相关接口。
|
|
final class SettingAPI {
|
|
private let client: APIClient
|
|
|
|
init(client: APIClient) {
|
|
self.client = client
|
|
}
|
|
|
|
/// 拉取后端配置的最新 App 版本。
|
|
func checkLatestVersion() async throws -> VersionResponse {
|
|
try await client.send(
|
|
APIRequest(method: .get, path: "/api/app/latest-version")
|
|
)
|
|
}
|
|
}
|