feat(training-plans): 添加训练计划名称字段并实现软删除功能
- 在 DTO 和模型中新增 name 字段,支持可选的计划名称 - 实现分页查询功能,优化列表接口返回结构 - 将删除操作改为软删除,新增 deleted 字段控制 - 更新服务逻辑以支持新字段和分页参数
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user