feature/wy
wangyong 3 weeks ago
parent 005d67a64a
commit d6418f695c

@ -12,7 +12,7 @@ import java.util.Date;
* Question * Question
* 使Lombok@Datagettersetter * 使Lombok@Datagettersetter
* Hibernate@EntityJPA * Hibernate@EntityJPA
* @DynamicUpdate * @DynamicUpdate
*/ */
@Data @Data
@Entity @Entity

@ -6,7 +6,11 @@
***********************************************************/ ***********************************************************/
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;
@ -17,15 +21,26 @@ 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; private Integer questionLevelId;//题目难度等级ID
@JsonProperty("name") @JsonProperty("name")
private String questionLevelName; private String questionLevelName;//题目难度等级名称
@JsonProperty("description") @JsonProperty("description")
private String questionLevelDescription; private String questionLevelDescription;//题目难度等级描述
} }

@ -11,12 +11,19 @@ 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,18 +13,25 @@ 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; private Integer id;// 角色id
private String role; private String role;// 角色名称
} }

@ -10,4 +10,6 @@ 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,13 +1,14 @@
/*********************************************************** /**
* @Description : * 访
* @author : 广(Laing Shan Guang) * JpaRepositoryQuestionLevel
* @date : 2019-05-14 08:26 * JpaRepositoryCRUD
* @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,13 +1,9 @@
/***********************************************************
* @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,19 +1,28 @@
/***********************************************************
* @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,13 +1,9 @@
/***********************************************************
* @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,9 +1,3 @@
/***********************************************************
* @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;
@ -11,6 +5,9 @@ import lombok.Data;
import java.util.List; import java.util.List;
/**
* VO
*/
@Data @Data
public class QuestionCreateSimplifyVo { public class QuestionCreateSimplifyVo {
/** /**
@ -19,6 +16,9 @@ public class QuestionCreateSimplifyVo {
@JsonProperty("name") @JsonProperty("name")
private String questionName; private String questionName;
/**
*
*/
@JsonProperty("desc") @JsonProperty("desc")
private String questionDescription; private String questionDescription;

@ -1,9 +1,3 @@
/***********************************************************
* @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;
@ -11,6 +5,9 @@ import lombok.Data;
import java.util.List; import java.util.List;
/**
*
*/
@Data @Data
public class QuestionCreateVo { public class QuestionCreateVo {
/** /**
@ -19,6 +16,9 @@ public class QuestionCreateVo {
@JsonProperty("name") @JsonProperty("name")
private String questionName; private String questionName;
/**
*
*/
@JsonProperty("desc") @JsonProperty("desc")
private String questionDescription; private String questionDescription;

@ -1,9 +1,3 @@
/***********************************************************
* @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;
@ -12,6 +6,9 @@ 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 {
/** /**
@ -28,14 +25,17 @@ 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,25 +1,29 @@
/***********************************************************
* @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,25 +1,45 @@
/*********************************************************** /**
* @Description : * QuestionOptionVo
* @author : 广(Laing Shan Guang) *
* @date : 2019-06-01 09:45 * 使Lombok@Datagettersetter
* @email : liangshanguang2@gmail.com * 使Jackson@JsonProperty便JSON
***********************************************************/ */
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,9 +1,3 @@
/***********************************************************
* @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;
@ -11,6 +5,9 @@ import lombok.Data;
import java.util.List; import java.util.List;
/**
*
*/
@Data @Data
public class QuestionPageVo { public class QuestionPageVo {

@ -1,9 +1,7 @@
/*********************************************************** /**
* @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;
@ -14,14 +12,30 @@ 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,9 +1,3 @@
/***********************************************************
* @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;
@ -13,14 +7,27 @@ 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;
@ -66,7 +73,9 @@ public class QuestionVo {
@JsonProperty("categoryId") @JsonProperty("categoryId")
private int questionCategoryId; private int questionCategoryId;
/**
*
*/
@JsonProperty("description") @JsonProperty("description")
private String questionDescription; private String questionDescription;
@ -76,7 +85,6 @@ public class QuestionVo {
@JsonProperty("options") @JsonProperty("options")
private List<QuestionOptionVo> questionOptionVoList; private List<QuestionOptionVo> questionOptionVoList;
/** /**
* Java * Java
* @DynamicUpdate * @DynamicUpdate

Loading…
Cancel
Save