import type { BodyCompositionResponse, GeneratePhysicalFitnessResponse, PhysicalFitnessResponse, } from "./types"; import { api } from "./client"; /** 取得指定使用者的 11 項最新體適能測驗成績。 */ export function fetchPhysicalFitness( userID: string, ): Promise { return api .get(`v1/physical-fitness/${encodeURIComponent(userID)}`) .json(); } /** 產生指定使用者的體適能評級。 */ export function generatePhysicalFitness( userID: string, ): Promise { return api .post(`v1/physical-fitness/generate/${encodeURIComponent(userID)}`) .json(); } /** 取得指定使用者的身體組成分析。 */ export function fetchBodyComposition( userCode: string, ): Promise { return api .get(`v1/physical-fitness/body-composition/${encodeURIComponent(userCode)}`) .json(); }