HealthService.swift
810 Bytes
//
// HealthService.swift
// hippo-watch Watch App
//
// Created by shihao on 2025/7/8.
//
import Foundation
class HealthService {
private let apiClient = APIClient.shared
func getTodayStatusInfo() async throws -> TodayHealthInfo {
return try await apiClient.request(HealthEndpoint.getTodayStatusInfo)
}
func getLatestHRV() async throws -> LatestHRV {
return try await apiClient.request(HealthEndpoint.getLatestHRV)
}
func upload(data: [String: Any]) async throws -> LatestHRV {
return try await apiClient.request(HealthEndpoint.upload(data: data))
}
func uploadPulse(pulseType: PulseType) async throws -> EmptyResponse {
return try await apiClient.request(HealthEndpoint.uploadPulse(pulseType: pulseType))
}
}