SubjectTestPublishGradeController.java
3.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.common.interceptor.LoginRequired;
import com.meishu.dto.grade.AddGradeDTO;
import com.meishu.model.SubjectTestPublishGradeDO;
import com.meishu.service.SubjectTestPublishGradeService;
import com.meishu.util.ConstantUtils;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 档次表 前端控制器
* </p>
*
* @author Tuyp
* @since 2021-06-21
*/
@RestController
@Api(tags = "档次表")
@RequestMapping("/subjectGrade")
public class SubjectTestPublishGradeController {
@Autowired
private SubjectTestPublishGradeService subjectTestPublishGradeService;
@PostMapping("addGrade")
@ApiOperation("添加一个档次 gradeName档次名称 publishId 发布id content 综合评价 subjectTestGradeExampleMappingDOS [exampleView 样卷地址] subjectTestGradeStarMappingDOS [starId 星级id]")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addGrade(@RequestBody AddGradeDTO addGradeDTO){
return ResponseData.generateCreatedResponse(0,subjectTestPublishGradeService.addGrade(addGradeDTO));
}
@PostMapping("deleteGrade")
@ApiOperation("删除一个档次 id 档次id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO deleteGrade(@RequestBody SubjectTestPublishGradeDO subjectTestPublishGradeDO){
return ResponseData.generateCreatedResponse(0,subjectTestPublishGradeService.deleteGrade(subjectTestPublishGradeDO));
}
@PostMapping("queryGrade")
@ApiOperation("查询档次全部档次")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO queryGrade(@RequestBody SubjectTestPublishGradeDO subjectTestPublishGradeDO){
return ResponseData.generateCreatedResponse(0,subjectTestPublishGradeService.queryGrade(subjectTestPublishGradeDO));
}
@PostMapping("queryOneGrade")
@ApiOperation("查询单个档次 id")
// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO queryOneGrade(@RequestBody SubjectTestPublishGradeDO subjectTestPublishGradeDO){
return ResponseData.generateCreatedResponse(0,subjectTestPublishGradeService.queryOneGrade(subjectTestPublishGradeDO));
}
@PostMapping("updateGrade")
@ApiOperation("编辑某个档次 id gradeName档次名称 publishId 发布id subjectTestGradeExampleMappingDOS [exampleView 样卷地址] subjectTestGradeStarMappingDOS [starId 星级id] ")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateGrade(@RequestBody AddGradeDTO addGradeDTO){
return ResponseData.generateCreatedResponse(0,subjectTestPublishGradeService.updateGrade(addGradeDTO));
}
@PostMapping("getRuleIdByPublishId")
@ApiOperation("通过publishId查询ruleId {publishId 发布id}")
public ResponseVO getRuleIdByPublishId(@RequestBody SubjectTestPublishGradeDO subjectTestPublishGradeDO){
return ResponseData.generateCreatedResponse(0,subjectTestPublishGradeService.getRuleIdByPublishId(subjectTestPublishGradeDO));
}
}