Compare commits

..

No commits in common. '1494e5b6dc994f4f816d98a78b551d85d0a0bb28' and 'ffe9f1c9bd0b3b1badd42af00be9893799ba8f7e' have entirely different histories.

@ -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,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;
/**

Loading…
Cancel
Save