KnowledgeSubjectDictController.java
4.13 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
package com.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.common.interceptor.LoginRequired;
import com.meishu.dto.subject.GetSubjectAdministerDTO;
import com.meishu.dto.subject.GetSubjectTreeDTO;
import com.meishu.dto.subject.GetSubjectsDTO;
import com.meishu.model.KnowledgeSubjectDictDO;
import com.meishu.service.KnowledgeSubjectDictService;
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-04-27
*/
@RestController
@Api(tags = "学科字典表")
@RequestMapping("/subjectDict")
public class KnowledgeSubjectDictController {
@Autowired
private KnowledgeSubjectDictService knowledgeSubjectDictService;
@PostMapping("getSubjects")
@ApiOperation("获取所有学科 {userId登录人id subjectType:学科类型 subjectName 学科名称 pageSize pageNum}")
// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getSubjects(@RequestBody GetSubjectsDTO getSubjectsDTO){
return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.getSubjects(getSubjectsDTO));
}
@PostMapping("getAllSubjects")
@ApiOperation("获取所有学科 {subjectType:学科类型 subjectName 学科名称 }")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getAllSubjects(@RequestBody GetSubjectsDTO getSubjectsDTO){
return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.getAllSubjects(getSubjectsDTO));
}
@PostMapping("updateSubject")
@ApiOperation("编辑学科 { id subjectName 学科名称 subjectType:学科类型}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateSubject(@RequestBody KnowledgeSubjectDictDO subjectDictDO){
return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.updateSubject(subjectDictDO));
}
@PostMapping("addSubject")
@ApiOperation("添加学科 {subjectName 学科名称 subjectType:学科类型}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addSubject(@RequestBody KnowledgeSubjectDictDO subjectDictDO){
return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.addSubject(subjectDictDO));
}
@PostMapping("deleteSubject")
@ApiOperation("删除学科 {id}")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO deleteSubject(@RequestBody KnowledgeSubjectDictDO subjectDictDO){
return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.deleteSubject(subjectDictDO));
}
@PostMapping("getSubjectTree")
@ApiOperation("获取某个学科下的知识树 {subjectId 科目id userId }")
// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getSubjectTree(@RequestBody GetSubjectTreeDTO getSubjectTreeDTO){
return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.getSubjectTree(getSubjectTreeDTO));
}
@PostMapping("getSubject")
@ApiOperation("获取学科详情 id")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getSubject(@RequestBody KnowledgeSubjectDictDO subjectDictDO){
return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.getSubject(subjectDictDO));
}
@PostMapping("getSubjectAdminister")
@ApiOperation("获取某个科目下的老师 subjectId 科目id userName名字")
public ResponseVO getSubjectAdminister(@RequestBody GetSubjectAdministerDTO getSubjectAdministerDTO){
return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.getSubjectAdminister(getSubjectAdministerDTO));
}
}