Default Changelist

feature/qzw
秦泽旺 3 months ago
parent 76a8830ba9
commit 1735a3d5d2

@ -4,51 +4,60 @@
* @date : 2019/5/14 07:42 * @date : 2019/5/14 07:42
* @email : liangshanguang2@gmail.com * @email : liangshanguang2@gmail.com
***********************************************************/ ***********************************************************/
// 定义包名,用于组织类文件,避免命名冲突
package lsgwr.exam.entity; package lsgwr.exam.entity;
// 导入Jackson库的JsonFormat注解用于JSON序列化时自定义日期格式
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
// 导入Lombok库的Data注解用于自动生成getter、setter、equals、hashCode和toString方法
import lombok.Data; import lombok.Data;
// 导入Hibernate的DynamicUpdate注解用于在实体更新时只更新发生变化的字段
import org.hibernate.annotations.DynamicUpdate; import org.hibernate.annotations.DynamicUpdate;
// 导入JPA的Entity注解用于声明该类是一个JPA实体类
import javax.persistence.Entity; import javax.persistence.Entity;
// 导入JPA的Id注解用于声明该类中的某个字段作为主键
import javax.persistence.Id; import javax.persistence.Id;
// 导入Java的Date类用于表示日期和时间
import java.util.Date; import java.util.Date;
@Entity @Entity
@Data @Data
@DynamicUpdate @DynamicUpdate
public class Exam { public class Exam {
// 使用JPA的@Id注解声明该字段为主键
@Id @Id
private String examId; private String examId;// 考试ID唯一标识一场考试
private String examName; private String examName;// 考试名称
private String examAvatar; private String examAvatar; // 考试头像或图标
private String examDescription; private String examDescription;// 考试描述或简介
private String examQuestionIds; private String examQuestionIds;// 存储所有问题ID的字符串可能是逗号分隔的ID列表
private String examQuestionIdsRadio; private String examQuestionIdsRadio;// 存储所有单选题ID的字符串
private String examQuestionIdsCheck; private String examQuestionIdsCheck;// 存储所有多选题ID的字符串
private String examQuestionIdsJudge; private String examQuestionIdsJudge;// 存储所有判断题ID的字符串
private Integer examScore; private Integer examScore;// 考试总分
private Integer examScoreRadio; private Integer examScoreRadio;// 单选题总分
private Integer examScoreCheck; private Integer examScoreCheck;// 多选题总分
private Integer examScoreJudge; private Integer examScoreJudge;// 判断题总分
private String examCreatorId; private String examCreatorId;// 创建者ID标识谁创建了这场考试
private Integer examTimeLimit; private Integer examTimeLimit;// 考试时间限制,单位可能是分钟
// 考试开始时间使用Jackson的@JsonFormat注解自定义日期格式
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date examStartDate; private Date examStartDate;
// 考试结束时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date examEndDate; private Date examEndDate;
/** /**
* , Java * Java
* 使Jackson@JsonFormat便
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime; private Date createTime;
/** /**
* Java * Java
* @DynamicUpdate * 使Hibernate@DynamicUpdate
* 使Jackson@JsonFormat便
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updateTime; private Date updateTime;

@ -7,42 +7,44 @@
package lsgwr.exam.entity; package lsgwr.exam.entity;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;// 引入Jackson库用于日期格式化的注解
import lombok.Data; import lombok.Data;// 引入Lombok库用于简化Java实体类的编写如自动生成getter和setter方法
import javax.persistence.Entity; import javax.persistence.Entity;// 引入JPA注解用于标识这是一个实体类并映射到数据库中的一张表
// 引入JPA注解用于标识实体类的主键字段
import javax.persistence.Id; import javax.persistence.Id;
import java.util.Date; import java.util.Date;
// 使用@Data注解自动生成getter和setter方法以及toString、equals和hashCode方法
@Data @Data
// 使用@Entity注解标识这是一个JPA实体类
@Entity @Entity
public class ExamRecord { public class ExamRecord {
/** /**
* *
*/ */
@Id @Id
private String examRecordId; private String examRecordId;
/** /**
* id * ID
*/ */
private String examId; private String examId;
/** /**
* (_-), * 线_线-
*/ */
private String answerOptionIds; private String answerOptionIds;
/** /**
* userid * IDID
*/ */
private String examJoinerId; private String examJoinerId;
/** /**
* *
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date examJoinDate; private Date examJoinDate;
/** /**
* () *
*/ */
private Integer examTimeCost; private Integer examTimeCost;
/** /**
@ -50,7 +52,7 @@ public class ExamRecord {
*/ */
private Integer examJoinScore; private Integer examJoinScore;
/** /**
* *
*/ */
private Integer examResultLevel; private Integer examResultLevel;
} }

@ -7,21 +7,22 @@
package lsgwr.exam.entity; package lsgwr.exam.entity;
import lombok.Data; import lombok.Data;// 引入Lombok库中的@Data注解用于自动生成getter、setter、toString、equals和hashCode方法
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Entity;// 引入JPAJava Persistence API中的@Entity注解标识这是一个实体类与数据库中的表相对应
import javax.persistence.GeneratedValue;// 引入JPA中的@GeneratedValue注解用于指定主键的生成策略这里未明确指定策略将使用默认策略
import javax.persistence.Id;// 引入JPA中的@Id注解标识实体类的主键字段
// 使用@Data注解自动生成getter、setter等方法
@Data @Data
// 使用@Entity注解标识这是一个JPA实体类
@Entity @Entity
public class ExamRecordLevel { public class ExamRecordLevel {
// 考试记录等级ID // 考试记录等级ID,是主键,通过@Id注解标识并通过@GeneratedValue注解指定主键生成策略
@Id @Id
@GeneratedValue @GeneratedValue
private Integer examRecordLevelId; private Integer examRecordLevelId;
// 考试记录等级名称 // 考试记录等级名称,用于标识等级,如“优秀”、“良好”等
private String examRecordLevelName; private String examRecordLevelName;
// 考试记录等级描述 // 考试记录等级描述,用于对等级进行更详细的说明
private String examRecordLevelDescription; private String examRecordLevelDescription;
} }
Loading…
Cancel
Save