feat(training-plans): 添加训练计划名称字段并实现软删除功能

- 在 DTO 和模型中新增 name 字段,支持可选的计划名称
- 实现分页查询功能,优化列表接口返回结构
- 将删除操作改为软删除,新增 deleted 字段控制
- 更新服务逻辑以支持新字段和分页参数
This commit is contained in:
richarjiang
2025-08-14 17:32:55 +08:00
parent 96a1190f74
commit 9ad65b19fd
4 changed files with 44 additions and 12 deletions

View File

@@ -15,6 +15,10 @@ export class TrainingPlan extends Model {
@Column({ type: DataType.STRING, allowNull: false })
declare userId: string;
// 计划名称
@Column({ type: DataType.STRING, allowNull: true })
declare name: string;
@Column({ type: DataType.DATE, allowNull: false })
declare createdAt: Date;
@@ -44,6 +48,9 @@ export class TrainingPlan extends Model {
@Column({ type: DataType.DATE, defaultValue: DataType.NOW })
declare updatedAt: Date;
@Column({ type: DataType.BOOLEAN, defaultValue: false })
declare deleted: boolean;
}