更新注释 #1

Closed
p5yt4qn87 wants to merge 0 commits from feature/wy into develop

@ -3,9 +3,6 @@ package lsgwr.exam;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* Spring BootSpring Boot
*/
@SpringBootApplication
public class ExamApplication {

@ -1,6 +1,9 @@
/**
* @Description : REST,HTTP,,
*/
/***********************************************************
* @Description :
* @author : 广(Laing Shan Guang)
* @date : 2019-05-28 08:04
* @email : liangshanguang2@gmail.com
***********************************************************/
package lsgwr.exam.controller;
import lsgwr.exam.entity.Exam;
@ -19,16 +22,11 @@ import java.util.List;
@RestController
@Api(tags = "Exam APIs")
//将此控制器中的所有端点映射到/api/exam URL路径
@RequestMapping("/api/exam")
public class ExamController {
@Autowired //注入一个ExamService实例用于处理与考试和问题相关的业务逻辑
@Autowired
private ExamService examService;
/**
* @Description: 使examService.getQuestionAll(),ResultVO,
* @ApiOperationAPI,SwaggerUI
*/
@GetMapping("/question/all")
@ApiOperation("获取所有问题的列表")
ResultVO<List<QuestionVo>> getQuestionAll() {
@ -43,10 +41,6 @@ public class ExamController {
return resultVO;
}
/**
* @Description: QuestionVo使examService.updateQuestion()
* @param questionVo QuestionVo
*/
@PostMapping("/question/update")
@ApiOperation("更新问题")
ResultVO<QuestionVo> questionUpdate(@RequestBody QuestionVo questionVo) {
@ -61,13 +55,6 @@ public class ExamController {
}
}
/**
*
* @Description: QuestionCreateSimplifyVoQuestionCreateVoID使examService.questionCreate()
* @param questionCreateSimplifyVo QuestionCreateSimplifyVo
* @param request HttpServletRequestID
* @return ResultVO<String>
*/
@PostMapping("/question/create")
@ApiOperation("创建问题")
ResultVO<String> questionCreate(@RequestBody QuestionCreateSimplifyVo questionCreateSimplifyVo, HttpServletRequest request) {
@ -87,10 +74,6 @@ public class ExamController {
}
}
/**
* @Description: ,使examService.getSelections()ResultVO
* @return ResultVO<QuestionAllVo>
*/
@GetMapping("/question/selection")
@ApiOperation("获取问题分类的相关选项")
ResultVO<QuestionSelectionVo> getSelections() {
@ -102,11 +85,6 @@ public class ExamController {
}
}
/**
* @Description: 使examService.getQuestionDetail(id),ResultVO,
* @param id id
* @return ResultVO<QuestionDetailVo>
*/
@GetMapping("/question/detail/{id}")
@ApiOperation("根据问题的id获取问题的详细信息")
ResultVO<QuestionDetailVo> getQuestionDetail(@PathVariable String id) {
@ -123,10 +101,6 @@ public class ExamController {
return resultVO;
}
/**
* @Description: 使examService.getExamAll(),ResultVO,
* @return ResultVO<QuestionDetailVo>
*/
@GetMapping("/all")
@ApiOperation("获取全部考试的列表")
ResultVO<List<ExamVo>> getExamAll() {
@ -142,10 +116,6 @@ public class ExamController {
return resultVO;
}
/**
* @Description: 使examService.getExamQuestionTypeList(),ResultVO,
* @return ResultVO<ExamQuestionTypeVo>
*/
@GetMapping("/question/type/list")
@ApiOperation("获取问题列表,按照单选、多选和判断题分类返回")
ResultVO<ExamQuestionTypeVo> getExamQuestionTypeList() {
@ -161,12 +131,6 @@ public class ExamController {
return resultVO;
}
/**
* @Description: 使examService.createExam(),ResultVO,
* @param examCreateVo
* @param request id
* @return ResultVO<Exam>
*/
@PostMapping("/create")
@ApiOperation("创建考试")
ResultVO<Exam> createExam(@RequestBody ExamCreateVo examCreateVo, HttpServletRequest request) {
@ -183,12 +147,6 @@ public class ExamController {
return resultVO;
}
/**
* @Description: 使examService.updateExam(),ResultVO,
* @param examVo
* @param request id
* @return
*/
@PostMapping("/update")
@ApiOperation("更新考试")
ResultVO<Exam> updateExam(@RequestBody ExamVo examVo, HttpServletRequest request) {
@ -205,10 +163,6 @@ public class ExamController {
return resultVO;
}
/**
* @Description:
* @return ResultVO<List<ExamCardVo>>
*/
@GetMapping("/card/list")
@ApiOperation("获取考试列表,适配前端卡片列表")
ResultVO<List<ExamCardVo>> getExamCardList() {
@ -224,11 +178,6 @@ public class ExamController {
return resultVO;
}
/**
* @Description: id
* @param id id
* @return ResultVO<ExamDetailVo>
*/
@GetMapping("/detail/{id}")
@ApiOperation("根据考试的id获取考试详情")
ResultVO<ExamDetailVo> getExamDetail(@PathVariable String id) {
@ -243,13 +192,6 @@ public class ExamController {
return resultVO;
}
/**
* @Description: 使examService.finishExam,ResultVO,
* @param examId id
* @param answersMap
* @param request id
* @return
*/
@PostMapping("/finish/{examId}")
@ApiOperation("根据用户提交的答案对指定id的考试判分")
ResultVO<ExamRecord> finishExam(@PathVariable String examId, @RequestBody HashMap<String, List<String>> answersMap, HttpServletRequest request) {
@ -267,11 +209,6 @@ public class ExamController {
return resultVO;
}
/**
* @Description: 使examService.getExamRecordList,ResultVO,
* @param request id
* @return ResultVO<List<ExamRecordVo>> ResultVOResultVO
*/
@GetMapping("/record/list")
@ApiOperation("获取当前用户的考试记录")
ResultVO<List<ExamRecordVo>> getExamRecordList(HttpServletRequest request) {
@ -289,11 +226,6 @@ public class ExamController {
return resultVO;
}
/**
* @Description: 使examService.getExamRecordDetail,ResultVO,id
* @param recordId id
* @return ResultVO<RecordDetailVo> ResultVOResultVO
*/
@GetMapping("/record/detail/{recordId}")
@ApiOperation("根据考试记录id获取考试记录详情")
ResultVO<RecordDetailVo> getExamRecordDetail(@PathVariable String recordId) {

@ -1,12 +1,5 @@
/***********************************************************
* @Description :
* @author : 广(Laing Shan Guang)
* @date : 2019/5/14 07:46
* @email : liangshanguang2@gmail.com
***********************************************************/
package lsgwr.exam.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.annotations.DynamicUpdate;
@ -15,25 +8,70 @@ import javax.persistence.Entity;
import javax.persistence.Id;
import java.util.Date;
/**
* Question
* 使Lombok@Datagettersetter
* Hibernate@EntityJPA
* &#064;DynamicUpdate
*/
@Data
@Entity
@DynamicUpdate
public class Question {
/**
* ID
*/
@Id
private String questionId;
/**
*
*/
private String questionName;
/**
*
*/
private Integer questionScore;
/**
* ID
*/
private String questionCreatorId;
/**
* ID
*/
private Integer questionLevelId;
/**
* ID
*/
private Integer questionTypeId;
/**
* ID
*/
private Integer questionCategoryId;
/**
*
*/
private String questionDescription;
/**
* IDs
*/
private String questionOptionIds;
/**
* IDs
*/
private String questionAnswerOptionIds;
/**
* , Java
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;

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

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

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

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

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

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

@ -1,13 +1,14 @@
/***********************************************************
* @Description :
* @author : 广(Laing Shan Guang)
* @date : 2019-05-14 08:26
* @email : liangshanguang2@gmail.com
***********************************************************/
/**
* 访
* JpaRepositoryQuestionLevel
* JpaRepositoryCRUD
*/
package lsgwr.exam.repository;
import lsgwr.exam.entity.QuestionLevel;
import org.springframework.data.jpa.repository.JpaRepository;
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;
import lsgwr.exam.entity.QuestionOption;
import org.springframework.data.jpa.repository.JpaRepository;
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;
import lsgwr.exam.entity.Question;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
/**
* QuestionQuestion
*/
public interface QuestionRepository extends JpaRepository<Question, String> {
/**
* ID
*
* @param id ID
* @return ID
*/
List<Question> findByQuestionTypeId(Integer id);
/**
*
*
* @return
*/
@Query("select q from Question q order by q.updateTime desc")
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;
import lsgwr.exam.entity.QuestionType;
import org.springframework.data.jpa.repository.JpaRepository;
public interface QuestionTypeRepository extends JpaRepository<QuestionType, Integer> {
}
// 该接口继承了JpaRepository用于处理QuestionType实体的数据库操作
// Integer类型作为实体的主键类型
}

@ -1,38 +1,24 @@
/***********************************************************
* @Description :
* @author : 广(Laing Shan Guang)
* @date : 2019-06-23 19:30
* @email : liangshanguang2@gmail.com
***********************************************************/
package lsgwr.exam.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
/**
* @Description: ,便JSON
* API,JSON
* Lombok@Datagettersetter
* Jackson@JsonPropertyJSON使
*/
@Data
public class ExamCardVo {
/**
* ID
*/
@JsonProperty("id")
private String examId;
/**
*
*/
@JsonProperty("title")
private String examName;
/**
*
*/
@JsonProperty("avatar")
private String examAvatar;
/**
*
*/
@JsonProperty("content")
private String examDescription;
/**
*
*/
@JsonProperty("score")
private Integer examScore;
/**

@ -1,9 +1,3 @@
/***********************************************************
* @Description : ,
* @author : 广(Laing Shan Guang)
* @date : 2019-06-02 13:26
* @email : liangshanguang2@gmail.com
***********************************************************/
package lsgwr.exam.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
@ -11,6 +5,9 @@ import lombok.Data;
import java.util.List;
/**
* VO
*/
@Data
public class QuestionCreateSimplifyVo {
/**
@ -19,6 +16,9 @@ public class QuestionCreateSimplifyVo {
@JsonProperty("name")
private String questionName;
/**
*
*/
@JsonProperty("desc")
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;
import com.fasterxml.jackson.annotation.JsonProperty;
@ -11,6 +5,9 @@ import lombok.Data;
import java.util.List;
/**
*
*/
@Data
public class QuestionCreateVo {
/**
@ -19,6 +16,9 @@ public class QuestionCreateVo {
@JsonProperty("name")
private String questionName;
/**
*
*/
@JsonProperty("desc")
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;
import lsgwr.exam.entity.QuestionOption;
@ -12,6 +6,9 @@ import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
*
*/
@Data
public class QuestionDetailVo {
/**
@ -28,14 +25,17 @@ public class QuestionDetailVo {
*
*/
private String description;
/**
*
*/
private String type;
/**
*
*/
private List<QuestionOption> options;
/**
* ,id
*/

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

@ -1,25 +1,45 @@
/***********************************************************
* @Description :
* @author : 广(Laing Shan Guang)
* @date : 2019-06-01 09:45
* @email : liangshanguang2@gmail.com
***********************************************************/
/**
* QuestionOptionVo
*
* 使Lombok@Datagettersetter
* 使Jackson@JsonProperty便JSON
*/
package lsgwr.exam.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
/**
*
*/
@Data
public class QuestionOptionVo {
/**
*
* 使@JsonPropertyJSON
*/
@JsonProperty("id")
private String questionOptionId;
/**
*
* 使@JsonPropertyJSON
*/
@JsonProperty("content")
private String questionOptionContent;
/**
*
* false
* 使@JsonPropertyJSON
*/
@JsonProperty("answer")
private Boolean answer = false;
/**
*
* 使@JsonPropertyJSON
*/
@JsonProperty("description")
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;
import com.fasterxml.jackson.annotation.JsonProperty;
@ -11,6 +5,9 @@ import lombok.Data;
import java.util.List;
/**
*
*/
@Data
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;
import com.fasterxml.jackson.annotation.JsonProperty;
@ -14,14 +12,30 @@ import lombok.Data;
import java.util.List;
/**
*
*
*/
@Data
public class QuestionSelectionVo {
/**
*
*
*/
@JsonProperty("types")
private List<QuestionType> questionTypeList;
/**
*
*
*/
@JsonProperty("categories")
private List<QuestionCategory> questionCategoryList;
/**
*
*
*/
@JsonProperty("levels")
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;
import com.fasterxml.jackson.annotation.JsonFormat;
@ -13,14 +7,27 @@ import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* QuestionVo
* 使Lombok@Datagettersetter
*/
@Data
public class QuestionVo {
/**
*
*/
@JsonProperty("id")
private String questionId;
/**
*
*/
@JsonProperty("name")
private String questionName;
/**
*
*/
@JsonProperty("score")
private Integer questionScore;
@ -66,7 +73,9 @@ public class QuestionVo {
@JsonProperty("categoryId")
private int questionCategoryId;
/**
*
*/
@JsonProperty("description")
private String questionDescription;
@ -76,7 +85,6 @@ public class QuestionVo {
@JsonProperty("options")
private List<QuestionOptionVo> questionOptionVoList;
/**
* Java
* @DynamicUpdate

Loading…
Cancel
Save