注释了ExamController.java和UploadDownloadController.java

pull/5/head
李炫好 2 months ago
commit 523642ab49

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

@ -22,11 +22,16 @@ import java.util.List;
@RestController
@Api(tags = "Exam APIs")
//将此控制器中的所有端点映射到/api/exam URL路径
@RequestMapping("/api/exam")
public class ExamController {
@Autowired
@Autowired //注入一个ExamService实例用于处理与考试和问题相关的业务逻辑
private ExamService examService;
/**
* @Description: 使examService.getQuestionAll(),ResultVO,
* @ApiOperationAPI,SwaggerUI
*/
@GetMapping("/question/all")
@ApiOperation("获取所有问题的列表")
// 获取全部问题列表。
@ -66,6 +71,13 @@ ResultVO<List<QuestionVo>> getQuestionAll() {
}
}
/**
*
* @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) {
@ -90,6 +102,10 @@ ResultVO<List<QuestionVo>> getQuestionAll() {
}
}
/**
* @Description: ,使examService.getSelections()ResultVO
* @return ResultVO<QuestionAllVo>
*/
@GetMapping("/question/selection")
@ApiOperation("获取问题分类的相关选项")
// 获取问题分类选项。
@ -160,6 +176,7 @@ ResultVO<QuestionSelectionVo> getSelections() {
// 返回结果。
return resultVO;
}
@PostMapping("/create")
@ApiOperation("创建考试")
ResultVO<Exam> createExam(@RequestBody ExamCreateVo examCreateVo, HttpServletRequest request) {
@ -202,6 +219,10 @@ ResultVO<QuestionSelectionVo> getSelections() {
return resultVO;
}
/**
* @Description:
* @return ResultVO<List<ExamCardVo>>
*/
@GetMapping("/card/list")
@ApiOperation("获取考试列表,适配前端卡片列表")
ResultVO<List<ExamCardVo>> getExamCardList() {
@ -221,6 +242,11 @@ ResultVO<QuestionSelectionVo> getSelections() {
return resultVO;
}
/**
* @Description: id
* @param id id
* @return ResultVO<ExamDetailVo>
*/
@GetMapping("/detail/{id}")
@ApiOperation("根据考试的id获取考试详情")
ResultVO<ExamDetailVo> getExamDetail(@PathVariable String id) {
@ -235,6 +261,13 @@ ResultVO<QuestionSelectionVo> getSelections() {
return resultVO;
}
/**
* @Description: 使examService.finishExam,ResultVO,
* @param examId id
* @param answersMap
* @param request id
* @return
*/
@PostMapping("/finish/{examId}")
@ApiOperation("根据用户提交的答案对指定id的考试判分")
// 完成考试
@ -256,6 +289,11 @@ ResultVO<QuestionSelectionVo> getSelections() {
return resultVO;
}
/**
* @Description: 使examService.getExamRecordList,ResultVO,
* @param request id
* @return ResultVO<List<ExamRecordVo>> ResultVOResultVO
*/
@GetMapping("/record/list")
@ApiOperation("获取当前用户的考试记录")
// 获取考试记录列表。
@ -274,6 +312,11 @@ ResultVO<QuestionSelectionVo> getSelections() {
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,24 +1,38 @@
/***********************************************************
* @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;
/**

Loading…
Cancel
Save