|
|
@@ -24,31 +24,50 @@ export class WeightGoal {
|
|
|
@PrimaryColumn('varchar', { length: 36, comment: '目标ID(UUID)' })
|
|
|
id!: string;
|
|
|
|
|
|
- @Column('varchar', { length: 36, comment: '用户ID' })
|
|
|
+ @Column('varchar', { name: 'user_id', length: 36, comment: '用户ID' })
|
|
|
userId!: string;
|
|
|
|
|
|
- @Column('decimal', { precision: 5, scale: 2, comment: '目标体重(kg)' })
|
|
|
+ @Column('decimal', { name: 'target_weight', precision: 5, scale: 2, comment: '目标体重(kg)' })
|
|
|
targetWeight!: number;
|
|
|
|
|
|
- @Column('decimal', { precision: 4, scale: 2, nullable: true, comment: '目标体脂率(%)' })
|
|
|
+ @Column('decimal', {
|
|
|
+ name: 'target_body_fat',
|
|
|
+ precision: 4,
|
|
|
+ scale: 2,
|
|
|
+ nullable: true,
|
|
|
+ comment: '目标体脂率(%)'
|
|
|
+ })
|
|
|
targetBodyFat!: number | null;
|
|
|
|
|
|
- @Column('date', { comment: '目标日期' })
|
|
|
+ @Column('date', { name: 'target_date', comment: '目标日期' })
|
|
|
targetDate!: string;
|
|
|
|
|
|
- @Column('decimal', { precision: 5, scale: 2, comment: '起始体重(kg)' })
|
|
|
+ @Column('decimal', { name: 'start_weight', precision: 5, scale: 2, comment: '起始体重(kg)' })
|
|
|
startWeight!: number;
|
|
|
|
|
|
- @Column('decimal', { precision: 4, scale: 2, nullable: true, comment: '起始体脂率(%)' })
|
|
|
+ @Column('decimal', {
|
|
|
+ name: 'start_body_fat',
|
|
|
+ precision: 4,
|
|
|
+ scale: 2,
|
|
|
+ nullable: true,
|
|
|
+ comment: '起始体脂率(%)'
|
|
|
+ })
|
|
|
startBodyFat!: number | null;
|
|
|
|
|
|
- @Column('date', { comment: '开始日期' })
|
|
|
+ @Column('date', { name: 'start_date', comment: '开始日期' })
|
|
|
startDate!: string;
|
|
|
|
|
|
- @Column('decimal', { precision: 4, scale: 2, nullable: true, comment: '每周目标减重量(kg)' })
|
|
|
+ @Column('decimal', {
|
|
|
+ name: 'weekly_target',
|
|
|
+ precision: 4,
|
|
|
+ scale: 2,
|
|
|
+ nullable: true,
|
|
|
+ comment: '每周目标减重量(kg)'
|
|
|
+ })
|
|
|
weeklyTarget!: number | null;
|
|
|
|
|
|
@Column({
|
|
|
+ name: 'status',
|
|
|
type: 'enum',
|
|
|
enum: GoalStatus,
|
|
|
default: GoalStatus.ACTIVE,
|
|
|
@@ -56,16 +75,16 @@ export class WeightGoal {
|
|
|
})
|
|
|
status!: GoalStatus;
|
|
|
|
|
|
- @Column('timestamp', { nullable: true, comment: '完成时间' })
|
|
|
+ @Column('timestamp', { name: 'completed_at', nullable: true, comment: '完成时间' })
|
|
|
completedAt!: Date | null;
|
|
|
|
|
|
- @CreateDateColumn({ comment: '创建时间' })
|
|
|
+ @CreateDateColumn({ name: 'created_at', comment: '创建时间' })
|
|
|
createdAt!: Date;
|
|
|
|
|
|
- @UpdateDateColumn({ nullable: true, comment: '更新时间' })
|
|
|
+ @UpdateDateColumn({ name: 'updated_at', nullable: true, comment: '更新时间' })
|
|
|
updatedAt!: Date | null;
|
|
|
|
|
|
- @DeleteDateColumn({ nullable: true, comment: '软删除时间' })
|
|
|
+ @DeleteDateColumn({ name: 'deleted_at', nullable: true, comment: '软删除时间' })
|
|
|
deletedAt!: Date | null;
|
|
|
|
|
|
// 关联关系
|