feat: 新API

This commit is contained in:
skytek_xinliang
2026-09-14 12:03:04 +08:00
parent 1cfd948fec
commit 87aa5c9e33
5 changed files with 379 additions and 7 deletions
@@ -0,0 +1,23 @@
import type {
GeneratePhysicalFitnessResponse,
PhysicalFitnessItem,
} from "./types";
import { api } from "./client";
/** 取得指定使用者的 11 項最新體適能測驗成績。 */
export function fetchPhysicalFitness(
userID: string,
): Promise<PhysicalFitnessItem[]> {
return api
.get(`v1/physical-fitness/${encodeURIComponent(userID)}`)
.json<PhysicalFitnessItem[]>();
}
/** 產生指定使用者的體適能評級。 */
export function generatePhysicalFitness(
userID: string,
): Promise<GeneratePhysicalFitnessResponse> {
return api
.post(`v1/physical-fitness/generate/${encodeURIComponent(userID)}`)
.json<GeneratePhysicalFitnessResponse>();
}