|
|
@@ -61,7 +61,7 @@ public class QuestionController {
|
|
|
/**
|
|
|
* 获取某一题目信息
|
|
|
*/
|
|
|
- @Auth(roles = UserRole.TEACHER, message = "获取题目信息")
|
|
|
+ @Auth(roles = {UserRole.TEACHER}, message = "获取题目信息")
|
|
|
@GetMapping("/{questionId}")
|
|
|
public BaseQuestionVO getOneQuestion(LoginUser user, @PathVariable String questionId) {
|
|
|
return questionService.getOneQuestion(user, questionId);
|
|
|
@@ -116,7 +116,7 @@ public class QuestionController {
|
|
|
/**
|
|
|
* 收藏题目
|
|
|
*/
|
|
|
- @Auth(roles = UserRole.STUDENT, message = "收藏题目")
|
|
|
+ @Auth(roles = {UserRole.TEACHER, UserRole.STUDENT}, message = "收藏题目")
|
|
|
@PostMapping("/{questionId}/collect")
|
|
|
public void starQuestion(LoginUser user, @PathVariable String questionId, @Validated @RequestBody CollectDTO collectDTO) {
|
|
|
questionService.collectQuestion(user, questionId, collectDTO);
|
|
|
@@ -125,7 +125,7 @@ public class QuestionController {
|
|
|
/**
|
|
|
* 评价题目
|
|
|
*/
|
|
|
- @Auth(roles = UserRole.STUDENT, message = "评价题目")
|
|
|
+ @Auth(roles = {UserRole.TEACHER, UserRole.STUDENT}, message = "评价题目")
|
|
|
@PostMapping("/{questionId}/rate")
|
|
|
public void rateQuestion(LoginUser user, @PathVariable String questionId, @Validated @RequestBody RateDTO rateDTO) {
|
|
|
questionService.rateQuestion(user, questionId, rateDTO);
|
|
|
@@ -134,14 +134,14 @@ public class QuestionController {
|
|
|
/**
|
|
|
* 取得收藏评价的题目
|
|
|
*/
|
|
|
- @Auth(roles = UserRole.STUDENT, message = "取得收藏评价的题目")
|
|
|
+ @Auth(roles = {UserRole.TEACHER, UserRole.STUDENT}, message = "取得收藏评价的题目")
|
|
|
@GetMapping("/collected")
|
|
|
public PageResponse<BaseQuestionVO> getCollectedQuestions(LoginUser user,
|
|
|
@PageableDefault(size = Integer.MAX_VALUE) Pageable pageable) {
|
|
|
return PageResponse.of(questionService.getCollectedAndRatedQuestions(user, true, false, pageable));
|
|
|
}
|
|
|
|
|
|
- @Auth(roles = UserRole.STUDENT, message = "取得收藏评价的题目")
|
|
|
+ @Auth(roles = {UserRole.TEACHER, UserRole.STUDENT}, message = "取得收藏评价的题目")
|
|
|
@GetMapping("/rated")
|
|
|
public PageResponse<BaseQuestionVO> getRatedQuestions(LoginUser user,
|
|
|
@PageableDefault(size = Integer.MAX_VALUE) Pageable pageable) {
|
|
|
@@ -157,7 +157,10 @@ public class QuestionController {
|
|
|
return PageResponse.of(questionService.getCompletedQuestions(user, pageable));
|
|
|
}
|
|
|
|
|
|
- @Auth(roles = UserRole.STUDENT, message = "取得与题目的交互信息")
|
|
|
+ /**
|
|
|
+ * 取得与题目的交互信息
|
|
|
+ */
|
|
|
+ @Auth(roles = {UserRole.TEACHER, UserRole.STUDENT}, message = "取得与题目的交互信息")
|
|
|
@GetMapping("/interactive")
|
|
|
public List<InteractiveVO> getInteractiveList(LoginUser user, String questionId) {
|
|
|
return questionService.getInteractiveList(user, questionId);
|