You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
SmartGymManagementSystem/TrainingPlan.java

94 lines
3.0 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package com.gym.model;
import jakarta.persistence.*;
import lombok.Data;
import java.time.LocalDate;
import java.time.LocalDateTime;
@Entity
@Table(name = "training_plans")
@Data
public class TrainingPlan {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToOne
@JoinColumn(name = "member_id", nullable = false)
private User member; // 会员
@ManyToOne
@JoinColumn(name = "coach_id", nullable = false)
private User coach; // 教练
@Column(nullable = false, length = 100)
private String goal; // 训练目标:减脂、增肌、塑形、康复
@Column(name = "duration_weeks")
private Integer durationWeeks; // 训练周期(周)
@Column(name = "start_date")
private LocalDate startDate; // 开始日期
@Column(name = "end_date")
private LocalDate endDate; // 结束日期
@Column(name = "frequency_per_week")
private Integer frequencyPerWeek = 3; // 每周训练频率
@Column(name = "daily_plan", length = 2000)
private String dailyPlan; // 每日训练计划JSON格式或文本
@Column(name = "diet_advice", length = 1000)
private String dietAdvice; // 饮食建议
@Column(name = "completed_days")
private Integer completedDays = 0; // 已完成天数
private Double progress = 0.0; // 进度百分比
@Column(length = 20)
private String status = "ACTIVE"; // 状态ACTIVE, COMPLETED, PAUSED, CANCELLED
@Column(name = "create_time")
private LocalDateTime createTime = LocalDateTime.now();
@Column(name = "update_time")
private LocalDateTime updateTime = LocalDateTime.now();
// 训练内容详情可以存储为JSON
@Column(name = "training_content", length = 3000)
private String trainingContent; // 训练动作、组数、次数等
@Column(name = "rest_days")
private String restDays; // 休息日安排,如"1,3,5"表示周一、三、五休息
@Column(name = "difficulty_level")
private String difficultyLevel; // 难度级别BEGINNER, INTERMEDIATE, ADVANCED
@Column(name = "calories_target")
private Integer caloriesTarget; // 目标卡路里消耗
// 训练建议
@Column(name = "warmup_suggestions", length = 500)
private String warmupSuggestions; // 热身建议
@Column(name = "cooldown_suggestions", length = 500)
private String cooldownSuggestions; // 放松建议
@Column(name = "precautions", length = 1000)
private String precautions; // 注意事项
// 评估指标
@Column(name = "initial_weight")
private Double initialWeight; // 初始体重
@Column(name = "target_weight")
private Double targetWeight; // 目标体重
@Column(name = "initial_body_fat")
private Double initialBodyFat; // 初始体脂率
@Column(name = "target_body_fat")
private Double targetBodyFat; // 目标体脂率
}