import dayjs from 'dayjs'; import { api } from './api'; export type Article = { id: string; title: string; coverImage: string; htmlContent: string; publishedAt: string; // ISO string readCount: number; }; const demoArticles: Article[] = [ { id: 'intro-pilates-posture', title: '新手入门:普拉提核心与体态的关系', coverImage: 'https://plates-1251306435.cos.ap-guangzhou.myqcloud.com/images/imagedemo.jpeg', publishedAt: dayjs().subtract(2, 'day').toISOString(), readCount: 1268, htmlContent: `
核心是维持良好体态与动作稳定的关键。普拉提通过强调呼吸与深层肌群激活,帮助你在日常站立、坐姿与训练中保持更好的身体对齐。
更多实操可在本应用的「AI体态评估」中获取个性化建议。
`,
},
];
export function listRecommendedArticles(): Article[] {
// 实际项目中可替换为 API 请求
return demoArticles;
}
export async function getArticleById(id: string): Promise