优化训练计划列表接口返回结构,将数据包装为对象形式,包含列表、总数、页码和限制信息。

This commit is contained in:
richarjiang
2025-08-14 19:28:50 +08:00
parent 812ac5c21e
commit 821e17ac7d

View File

@@ -66,15 +66,17 @@ export class TrainingPlansService {
}); });
return { return {
data: rows.map(r => ({ data: {
id: r.id, list: rows.map(r => ({
createdAt: r.createdAt, id: r.id,
startDate: r.startDate, createdAt: r.createdAt,
goal: r.goal, startDate: r.startDate,
})), goal: r.goal,
total: count, })),
page, total: count,
limit, page,
limit,
},
}; };
} }