Compare commits

...

No commits in common. 'feature/wy' and 'main' have entirely different histories.

@ -1,5 +1,12 @@
/***********************************************************
* @Description :
* @author : 广(Laing Shan Guang)
* @date : 2019/5/14 07:46
* @email : liangshanguang2@gmail.com
***********************************************************/
package lsgwr.exam.entity; package lsgwr.exam.entity;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import org.hibernate.annotations.DynamicUpdate; import org.hibernate.annotations.DynamicUpdate;
@ -8,70 +15,25 @@ import javax.persistence.Entity;
import javax.persistence.Id; import javax.persistence.Id;
import java.util.Date; import java.util.Date;
/**
* Question
* 使Lombok@Datagettersetter
* Hibernate@EntityJPA
* @DynamicUpdate
*/
@Data @Data
@Entity @Entity
@DynamicUpdate @DynamicUpdate
public class Question { public class Question {
/**
* ID
*/
@Id @Id
private String questionId; private String questionId;
/**
*
*/
private String questionName; private String questionName;
/**
*
*/
private Integer questionScore; private Integer questionScore;
/**
* ID
*/
private String questionCreatorId; private String questionCreatorId;
/**
* ID
*/
private Integer questionLevelId; private Integer questionLevelId;
/**
* ID
*/
private Integer questionTypeId; private Integer questionTypeId;
/**
* ID
*/
private Integer questionCategoryId; private Integer questionCategoryId;
/**
*
*/
private String questionDescription; private String questionDescription;
/**
* IDs
*/
private String questionOptionIds; private String questionOptionIds;
/**
* IDs
*/
private String questionAnswerOptionIds; private String questionAnswerOptionIds;
/** /**
* , Java * , Java
*/ */
@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;

@ -6,11 +6,7 @@
***********************************************************/ ***********************************************************/
package lsgwr.exam.entity; package lsgwr.exam.entity;
/**
* QuestionCategory
* @EntityJPA
* Lombok@DatagettersettertoStringequalshashCode
*/
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data; import lombok.Data;
@ -21,26 +17,15 @@ import javax.persistence.Id;
@Data @Data
@Entity @Entity
public class QuestionCategory { public class QuestionCategory {
/**
* ID
* @Id
* @GeneratedValue
* @JsonPropertyJSON
*/
@Id @Id
@GeneratedValue @GeneratedValue
@JsonProperty("id") @JsonProperty("id")
private Integer questionCategoryId; private Integer questionCategoryId;
/**
*
* @JsonPropertyJSON
*/
@JsonProperty("name") @JsonProperty("name")
private String questionCategoryName; private String questionCategoryName;
/**
*
* @JsonPropertyJSON
*/
@JsonProperty("description") @JsonProperty("description")
private String questionCategoryDescription; private String questionCategoryDescription;
} }

@ -20,11 +20,11 @@ public class QuestionLevel {
@Id @Id
@GeneratedValue @GeneratedValue
@JsonProperty("id") @JsonProperty("id")
private Integer questionLevelId;//题目难度等级ID private Integer questionLevelId;
@JsonProperty("name") @JsonProperty("name")
private String questionLevelName;//题目难度等级名称 private String questionLevelName;
@JsonProperty("description") @JsonProperty("description")
private String questionLevelDescription;//题目难度等级描述 private String questionLevelDescription;
} }

@ -11,19 +11,12 @@ import lombok.Data;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Id; import javax.persistence.Id;
/**
*
* 使 @Entity JPA ORM
* 使 Lombok @Data gettersetter equalshash toString
*/
@Data @Data
@Entity @Entity
public class QuestionOption { public class QuestionOption {
/**
* 使 @Id
*/
@Id @Id
private String questionOptionId; private String questionOptionId;
private String questionOptionContent;// 选项内容,描述选项的文本或信息 private String questionOptionContent;
private String questionOptionDescription;// 选项描述,对选项的详细解释或注释 private String questionOptionDescription;
} }

@ -13,25 +13,18 @@ import lombok.Data;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.Id; import javax.persistence.Id;
/**
* QuestionType
* ID
*/
@Data @Data
@Entity @Entity
public class QuestionType { public class QuestionType {
/**
*
* @JsonProperty"id"
*/
@Id @Id
@GeneratedValue @GeneratedValue
@JsonProperty("id") @JsonProperty("id")
private Integer questionTypeId; private Integer questionTypeId;
/// 问题类型的名称。
@JsonProperty("name") @JsonProperty("name")
private String questionTypeName; private String questionTypeName;
//问题类型的描述。
@JsonProperty("description") @JsonProperty("description")
private String questionTypeDescription; private String questionTypeDescription;
} }

@ -18,12 +18,12 @@ public enum QuestionEnum {
CHECK(2, "多选题"), CHECK(2, "多选题"),
JUDGE(3, "判断题"); JUDGE(3, "判断题");
//构造函数,用于创建一个新的题目类型实例
QuestionEnum(Integer id, String role) { QuestionEnum(Integer id, String role) {
this.id = id; this.id = id;
this.role = role; this.role = role;
} }
private Integer id;// 角色id private Integer id;
private String role;// 角色名称 private String role;
} }

@ -10,6 +10,4 @@ import lsgwr.exam.entity.QuestionCategory;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
public interface QuestionCategoryRepository extends JpaRepository<QuestionCategory, Integer> { public interface QuestionCategoryRepository extends JpaRepository<QuestionCategory, Integer> {
// 该接口继承了JpaRepository用于处理QuestionCategory实体的数据库操作
// Integer类型作为实体的主键类型
} }

@ -1,14 +1,13 @@
/** /***********************************************************
* 访 * @Description :
* JpaRepositoryQuestionLevel * @author : 广(Laing Shan Guang)
* JpaRepositoryCRUD * @date : 2019-05-14 08:26
*/ * @email : liangshanguang2@gmail.com
***********************************************************/
package lsgwr.exam.repository; package lsgwr.exam.repository;
import lsgwr.exam.entity.QuestionLevel; import lsgwr.exam.entity.QuestionLevel;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
public interface QuestionLevelRepository extends JpaRepository<QuestionLevel, Integer> { public interface QuestionLevelRepository extends JpaRepository<QuestionLevel, Integer> {
// 该接口继承了JpaRepository用于处理QuestionLevel实体的数据库操作
// Integer类型参数表示实体的主键类型
} }

@ -1,9 +1,13 @@
/***********************************************************
* @Description :
* @author : 广(Laing Shan Guang)
* @date : 2019-05-14 08:27
* @email : liangshanguang2@gmail.com
***********************************************************/
package lsgwr.exam.repository; package lsgwr.exam.repository;
import lsgwr.exam.entity.QuestionOption; import lsgwr.exam.entity.QuestionOption;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
public interface QuestionOptionRepository extends JpaRepository<QuestionOption, String> { public interface QuestionOptionRepository extends JpaRepository<QuestionOption, String> {
// 该接口继承了JpaRepository用于处理QuestionOption实体的数据库操作 }
// 没有定义额外的方法意味着它利用JpaRepository提供的标准CRUD操作
}

@ -1,28 +1,19 @@
/***********************************************************
* @Description :
* @author : 广(Laing Shan Guang)
* @date : 2019-05-14 08:25
* @email : liangshanguang2@gmail.com
***********************************************************/
package lsgwr.exam.repository; package lsgwr.exam.repository;
import lsgwr.exam.entity.Question; import lsgwr.exam.entity.Question;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import java.util.List; import java.util.List;
/**
* QuestionQuestion
*/
public interface QuestionRepository extends JpaRepository<Question, String> { public interface QuestionRepository extends JpaRepository<Question, String> {
/**
* ID
*
* @param id ID
* @return ID
*/
List<Question> findByQuestionTypeId(Integer id); List<Question> findByQuestionTypeId(Integer id);
/**
*
*
* @return
*/
@Query("select q from Question q order by q.updateTime desc") @Query("select q from Question q order by q.updateTime desc")
List<Question> findAll(); List<Question> findAll();
} }

@ -1,9 +1,13 @@
/***********************************************************
* @Description :
* @author : 广(Laing Shan Guang)
* @date : 2019-05-14 08:28
* @email : liangshanguang2@gmail.com
***********************************************************/
package lsgwr.exam.repository; package lsgwr.exam.repository;
import lsgwr.exam.entity.QuestionType; import lsgwr.exam.entity.QuestionType;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
public interface QuestionTypeRepository extends JpaRepository<QuestionType, Integer> { public interface QuestionTypeRepository extends JpaRepository<QuestionType, Integer> {
// 该接口继承了JpaRepository用于处理QuestionType实体的数据库操作 }
// Integer类型作为实体的主键类型
}

@ -1,3 +1,9 @@
/***********************************************************
* @Description : ,
* @author : 广(Laing Shan Guang)
* @date : 2019-06-02 13:26
* @email : liangshanguang2@gmail.com
***********************************************************/
package lsgwr.exam.vo; package lsgwr.exam.vo;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
@ -5,9 +11,6 @@ import lombok.Data;
import java.util.List; import java.util.List;
/**
* VO
*/
@Data @Data
public class QuestionCreateSimplifyVo { public class QuestionCreateSimplifyVo {
/** /**
@ -16,9 +19,6 @@ public class QuestionCreateSimplifyVo {
@JsonProperty("name") @JsonProperty("name")
private String questionName; private String questionName;
/**
*
*/
@JsonProperty("desc") @JsonProperty("desc")
private String questionDescription; private String questionDescription;

@ -1,3 +1,9 @@
/***********************************************************
* @Description :
* @author : 广(Laing Shan Guang)
* @date : 2019-06-02 13:26
* @email : liangshanguang2@gmail.com
***********************************************************/
package lsgwr.exam.vo; package lsgwr.exam.vo;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
@ -5,9 +11,6 @@ import lombok.Data;
import java.util.List; import java.util.List;
/**
*
*/
@Data @Data
public class QuestionCreateVo { public class QuestionCreateVo {
/** /**
@ -16,9 +19,6 @@ public class QuestionCreateVo {
@JsonProperty("name") @JsonProperty("name")
private String questionName; private String questionName;
/**
*
*/
@JsonProperty("desc") @JsonProperty("desc")
private String questionDescription; private String questionDescription;

@ -1,3 +1,9 @@
/***********************************************************
* @Description :
* @author : 广(Laing Shan Guang)
* @date : 2019-10-20 09:51
* @email : liangshanguang2@gmail.com
***********************************************************/
package lsgwr.exam.vo; package lsgwr.exam.vo;
import lsgwr.exam.entity.QuestionOption; import lsgwr.exam.entity.QuestionOption;
@ -6,9 +12,6 @@ import lombok.Data;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
/**
*
*/
@Data @Data
public class QuestionDetailVo { public class QuestionDetailVo {
/** /**
@ -25,17 +28,14 @@ public class QuestionDetailVo {
* *
*/ */
private String description; private String description;
/** /**
* *
*/ */
private String type; private String type;
/** /**
* *
*/ */
private List<QuestionOption> options; private List<QuestionOption> options;
/** /**
* ,id * ,id
*/ */

@ -1,29 +1,25 @@
/***********************************************************
* @Description :
* @author : 广(Laing Shan Guang)
* @date : 2019-06-02 20:23
* @email : liangshanguang2@gmail.com
***********************************************************/
package lsgwr.exam.vo; package lsgwr.exam.vo;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data; import lombok.Data;
/**
*
*
*/
@Data @Data
public class QuestionOptionCreateVo { public class QuestionOptionCreateVo {
/** /**
* *
* 使@JsonPropertyJSON
* JSONJava
* JSON"content"Java"questionOptionContent"
*/ */
@JsonProperty("content") @JsonProperty("content")
private String questionOptionContent; private String questionOptionContent;
/** /**
* *
* false
* 使@JsonPropertyJSON
* JSON"answer"Java"answer"
*/ */
@JsonProperty("answer") @JsonProperty("answer")
private Boolean answer = false; private Boolean answer = false;

@ -1,45 +1,25 @@
/** /***********************************************************
* QuestionOptionVo * @Description :
* * @author : 广(Laing Shan Guang)
* 使Lombok@Datagettersetter * @date : 2019-06-01 09:45
* 使Jackson@JsonProperty便JSON * @email : liangshanguang2@gmail.com
*/ ***********************************************************/
package lsgwr.exam.vo; package lsgwr.exam.vo;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data; import lombok.Data;
/**
*
*/
@Data @Data
public class QuestionOptionVo { public class QuestionOptionVo {
/**
*
* 使@JsonPropertyJSON
*/
@JsonProperty("id") @JsonProperty("id")
private String questionOptionId; private String questionOptionId;
/**
*
* 使@JsonPropertyJSON
*/
@JsonProperty("content") @JsonProperty("content")
private String questionOptionContent; private String questionOptionContent;
/**
*
* false
* 使@JsonPropertyJSON
*/
@JsonProperty("answer") @JsonProperty("answer")
private Boolean answer = false; private Boolean answer = false;
/**
*
* 使@JsonPropertyJSON
*/
@JsonProperty("description") @JsonProperty("description")
private String questionOptionDescription; private String questionOptionDescription;
} }

@ -1,3 +1,9 @@
/***********************************************************
* @Description :
* @author : 广(Laing Shan Guang)
* @date : 2019-05-28 22:09
* @email : liangshanguang2@gmail.com
***********************************************************/
package lsgwr.exam.vo; package lsgwr.exam.vo;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
@ -5,9 +11,6 @@ import lombok.Data;
import java.util.List; import java.util.List;
/**
*
*/
@Data @Data
public class QuestionPageVo { public class QuestionPageVo {

@ -1,7 +1,9 @@
/** /***********************************************************
* * @Description :
* * @author : 广(Laing Shan Guang)
*/ * @date : 2019-06-03 07:35
* @email : liangshanguang2@gmail.com
***********************************************************/
package lsgwr.exam.vo; package lsgwr.exam.vo;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
@ -12,30 +14,14 @@ import lombok.Data;
import java.util.List; import java.util.List;
/**
*
*
*/
@Data @Data
public class QuestionSelectionVo { public class QuestionSelectionVo {
/**
*
*
*/
@JsonProperty("types") @JsonProperty("types")
private List<QuestionType> questionTypeList; private List<QuestionType> questionTypeList;
/**
*
*
*/
@JsonProperty("categories") @JsonProperty("categories")
private List<QuestionCategory> questionCategoryList; private List<QuestionCategory> questionCategoryList;
/**
*
*
*/
@JsonProperty("levels") @JsonProperty("levels")
private List<QuestionLevel> questionLevelList; private List<QuestionLevel> questionLevelList;
} }

@ -1,3 +1,9 @@
/***********************************************************
* @Description :
* @author : 广(Laing Shan Guang)
* @date : 2019-05-28 08:17
* @email : liangshanguang2@gmail.com
***********************************************************/
package lsgwr.exam.vo; package lsgwr.exam.vo;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
@ -7,27 +13,14 @@ import lombok.Data;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
/**
* QuestionVo
* 使Lombok@Datagettersetter
*/
@Data @Data
public class QuestionVo { public class QuestionVo {
/**
*
*/
@JsonProperty("id") @JsonProperty("id")
private String questionId; private String questionId;
/**
*
*/
@JsonProperty("name") @JsonProperty("name")
private String questionName; private String questionName;
/**
*
*/
@JsonProperty("score") @JsonProperty("score")
private Integer questionScore; private Integer questionScore;
@ -73,9 +66,7 @@ public class QuestionVo {
@JsonProperty("categoryId") @JsonProperty("categoryId")
private int questionCategoryId; private int questionCategoryId;
/**
*
*/
@JsonProperty("description") @JsonProperty("description")
private String questionDescription; private String questionDescription;
@ -85,6 +76,7 @@ public class QuestionVo {
@JsonProperty("options") @JsonProperty("options")
private List<QuestionOptionVo> questionOptionVoList; private List<QuestionOptionVo> questionOptionVoList;
/** /**
* Java * Java
* @DynamicUpdate * @DynamicUpdate

Loading…
Cancel
Save