优化训练计划列表接口返回结构,将数据包装为对象形式,包含列表、总数、页码和限制信息。
This commit is contained in:
@@ -66,15 +66,17 @@ export class TrainingPlansService {
|
||||
});
|
||||
|
||||
return {
|
||||
data: rows.map(r => ({
|
||||
id: r.id,
|
||||
createdAt: r.createdAt,
|
||||
startDate: r.startDate,
|
||||
goal: r.goal,
|
||||
})),
|
||||
total: count,
|
||||
page,
|
||||
limit,
|
||||
data: {
|
||||
list: rows.map(r => ({
|
||||
id: r.id,
|
||||
createdAt: r.createdAt,
|
||||
startDate: r.startDate,
|
||||
goal: r.goal,
|
||||
})),
|
||||
total: count,
|
||||
page,
|
||||
limit,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user