|
|
package com.gym.model;
|
|
|
|
|
|
import jakarta.persistence.*;
|
|
|
import lombok.Data;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.LocalTime;
|
|
|
|
|
|
@Entity
|
|
|
@Table(name = "courses")
|
|
|
@Data
|
|
|
public class Course {
|
|
|
@Id
|
|
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
|
private Long id;
|
|
|
|
|
|
@Column(nullable = false, length = 100)
|
|
|
private String name; // 课程名称
|
|
|
|
|
|
@Column(length = 50)
|
|
|
private String type; // 课程类型:瑜伽、动感单车、力量训练等
|
|
|
|
|
|
@Column(name = "start_time")
|
|
|
private LocalDateTime startTime; // 开始时间
|
|
|
|
|
|
@Column(name = "end_time")
|
|
|
private LocalDateTime endTime; // 结束时间
|
|
|
|
|
|
@Column(name = "duration_minutes")
|
|
|
private Integer durationMinutes; // 时长(分钟)
|
|
|
|
|
|
@Column(length = 100)
|
|
|
private String location; // 上课地点
|
|
|
|
|
|
@ManyToOne
|
|
|
@JoinColumn(name = "coach_id")
|
|
|
private User coach; // 教练
|
|
|
|
|
|
@Column(name = "max_participants")
|
|
|
private Integer maxParticipants = 20; // 最大参与人数
|
|
|
|
|
|
@Column(name = "current_participants")
|
|
|
private Integer currentParticipants = 0; // 当前参与人数
|
|
|
|
|
|
private Double price = 0.0; // 价格
|
|
|
|
|
|
@Column(length = 500)
|
|
|
private String description; // 课程描述
|
|
|
|
|
|
@Column(length = 20)
|
|
|
private String status = "UPCOMING"; // 状态:UPCOMING, ONGOING, COMPLETED, CANCELLED
|
|
|
|
|
|
@Column(name = "is_available")
|
|
|
private Boolean isAvailable = true; // 是否可预约
|
|
|
|
|
|
@Column(name = "create_time")
|
|
|
private LocalDateTime createTime = LocalDateTime.now();
|
|
|
} |