AdministerController.java
11 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.administer.*;
import com.subsidy.model.AdministerDO;
import com.subsidy.model.ExerciseDoneHistoryDO;
import com.subsidy.model.ExerciseDoneResultDO;
import com.subsidy.model.MemberDO;
import com.subsidy.service.AdministerService;
import com.subsidy.util.ConstantUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.net.InetAddress;
/**
* <p>
* 管理平台用户 前端控制器
* </p>
*
* @author DengMin
* @since 2021-10-11
*/
@RestController
@Api(tags = "管理平台用户")
@RequestMapping("/administer")
public class AdministerController {
@Autowired
private AdministerService administerService;
// @GetMapping("getIp")
// public String getIp()throws Exception{
// InetAddress addr = InetAddress.getLocalHost();
// return addr.getHostAddress();
// }
@PostMapping("/login")
@ApiOperation("登录接口 accountName password")
public ResponseVO login(@RequestBody AdministerDO administerDO){
return ResponseData.generateCreatedResponse(0,administerService.login(administerDO));
}
@PostMapping("/getPermissions")
@ApiOperation("权限查询")
@LoginRequired
public ResponseVO getPermissions() {
return ResponseData.generateCreatedResponse(0, administerService.getPermissions());
}
@PostMapping("/administers")
@ApiOperation("查询所有运营者 { userName pageNum pageSize }")
// @LoginRequired
public ResponseVO operators(@RequestBody OperatorsDTO operatorsDTO){
return ResponseData.generateCreatedResponse(0,administerService.operators(operatorsDTO));
}
@PostMapping("addAdminister")
@ApiOperation("添加运营者 id userName 名称 accountName 账号 ")
@LoginRequired
public ResponseVO addAdminister(@RequestBody AdministerDO administerDO){
return ResponseData.generateCreatedResponse(0,administerService.addAdminister(administerDO));
}
@PostMapping("deleteAdminister")
@ApiOperation("添加运营者 id ")
@LoginRequired
public ResponseVO deleteAdminister(@RequestBody AdministerDO administerDO){
return ResponseData.generateCreatedResponse(0,administerService.deleteAdminister(administerDO));
}
@PostMapping("updateAdminister")
@ApiOperation("编辑运营者 id userName 名称 accountName 账号 password")
@LoginRequired
public ResponseVO updateAdminister(@RequestBody AdministerDO administerDO){
return ResponseData.generateCreatedResponse(0,administerService.updateAdminister(administerDO));
}
@PostMapping("classSummary")
@ApiOperation("班级详情--数据概览 id 班级id ")
@LoginRequired
public ResponseVO classSummary(@RequestBody ClassDetailDTO classDetailDTO){
return ResponseData.generateCreatedResponse(0,administerService.classSummary(classDetailDTO));
}
@PostMapping("classDetail")
@ApiOperation("班级管理--班级成员 id 班级id userName pageSize pageNum")
@LoginRequired
public ResponseVO classDetail(@RequestBody ClassDetailDTO classDetailDTO){
return ResponseData.generateCreatedResponse(0,administerService.classDetail(classDetailDTO));
}
@PostMapping("exportClassDetail")
@ApiOperation("班级管理--班级成员--导出 id 班级id userName")
@LoginRequired
public void exportClassDetail(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{
classDetailDTO.setFlag(true);
administerService.exportClassDetail(classDetailDTO);
}
@PostMapping("signDetail")
@ApiOperation("班级管理--注册签到 id 班级id userName pageSize pageNum")
@LoginRequired
public ResponseVO signDetail(@RequestBody ClassDetailDTO classDetailDTO){
return ResponseData.generateCreatedResponse(0,administerService.signDetail(classDetailDTO));
}
@PostMapping("exportSignDetail")
@ApiOperation("班级管理--注册签到 id 班级id userName")
@LoginRequired
public void exportSignDetail(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{
classDetailDTO.setFlag(true);
administerService.exportSignDetail(classDetailDTO);
}
@PostMapping("exerciseTest")
@ApiOperation("班级管理--测评成绩 id 班级id userName paperId pageSize pageNum")
@LoginRequired
public ResponseVO exerciseTest(@RequestBody ClassDetailDTO classDetailDTO){
return ResponseData.generateCreatedResponse(0,administerService.exerciseTest(classDetailDTO));
}
@PostMapping("exportExerciseTest")
@ApiOperation("班级管理--测评成绩 id 班级id userName paperId")
@LoginRequired
public void exportExerciseTest(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{
classDetailDTO.setFlag(true);
administerService.exportExerciseTest(classDetailDTO);
}
@PostMapping("getMemberPapers")
@ApiOperation("获取某个成员某个卷子的做题历史 memberId paperId")
@LoginRequired
public ResponseVO getMemberPapers(@RequestBody ExerciseDoneResultDO exerciseDoneResultDO){
return ResponseData.generateCreatedResponse(0,administerService.getMemberPapers(exerciseDoneResultDO));
}
@PostMapping("getPaperDetail")
@ApiOperation("获取某个卷子做题详情 doneId getMemberPapers接口返回id memberId成员id")
@LoginRequired
public ResponseVO getPaperDetail(@RequestBody ExerciseDoneHistoryDO exerciseDoneHistoryDO){
return ResponseData.generateCreatedResponse(0,administerService.getPaperDetail(exerciseDoneHistoryDO));
}
@PostMapping("answerRecord")
@ApiOperation("班级管理--答疑 id 班级id userName")
@LoginRequired
public ResponseVO answerRecord(@RequestBody ClassDetailDTO classDetailDTO){
return ResponseData.generateCreatedResponse(0,administerService.answerRecord(classDetailDTO));
}
@PostMapping("exportAnswerRecord")
@ApiOperation("班级管理--答疑 id 班级id userName")
@LoginRequired
public void exportAnswerRecord(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{
classDetailDTO.setFlag(true);
administerService.exportAnswerRecord(classDetailDTO);
}
@PostMapping("classVodInfo")
@ApiOperation("学习记录---课件进度提醒 {courseId 课程id classId 班级id vodName视频名称}")
@LoginRequired
public ResponseVO classVodInfo(@RequestBody ClassVodInfoDTO classVodInfoDTO){
return ResponseData.generateCreatedResponse(0,administerService.classVodInfo(classVodInfoDTO));
}
@PostMapping("classDailyInfo")
@ApiOperation("学习记录---每日学习时长 {courseId 课程id classId 班级id userName startDate endDate}")
@LoginRequired
public ResponseVO classDailyInfo(@RequestBody ClassDailyInfoDTO classDailyInfoDTO){
return ResponseData.generateCreatedResponse(0,administerService.classDailyInfo(classDailyInfoDTO));
}
@PostMapping("exportClassDailyInfo")
@ApiParam("每日学习日志")
@LoginRequired
public void exportVodInfo(@RequestBody ClassDailyInfoDTO classDailyInfoDTO){
administerService.exportClassDailyInfo(classDailyInfoDTO);
}
@PostMapping("classVodDailyInfo")
@ApiOperation("学习记录---每日学习时长(视频维度)")
@LoginRequired
public ResponseVO classVodDailyInfo(@RequestBody ClassVodDailyInfoDTO classVodDailyInfoDTO ){
return ResponseData.generateCreatedResponse(0,administerService.classVodDailyInfo(classVodDailyInfoDTO));
}
@PostMapping("exportClassVodDailyInfo")
@ApiOperation("学习记录---每日学习时长(视频维度) pageSize pageNum userName classId")
@LoginRequired
public void exportClassVodDailyInfo(@RequestBody ClassVodDailyInfoDTO classVodDailyInfoDTO ){
administerService.exportClassVodDailyInfo(classVodDailyInfoDTO);
}
@PostMapping("memberStudy")
@ApiOperation("学员学习日志 pageSize pageNum classId memberId")
@LoginRequired
public ResponseVO memberStudy(@RequestBody MemberStudyLogDTO memberStudyLogDTO){
return ResponseData.generateCreatedResponse(0,administerService.memberStudy(memberStudyLogDTO));
}
@PostMapping("memberDetectionRecord")
@ApiOperation("获取某个班级活跃度检测记录 id userName pageSize pageNum ")
@LoginRequired
public ResponseVO memberDetectionRecord(@RequestBody ClassDetailDTO classDetailDTO ){
return ResponseData.generateCreatedResponse(0,administerService.memberDetectionRecord(classDetailDTO));
}
@PostMapping("exportMemberDetectionRecord")
@ApiOperation("获取某个班级活跃度检测记录 id userName ")
@LoginRequired
public void exportMemberDetectionRecord(@RequestBody ClassDetailDTO classDetailDTO ){
administerService.exportMemberDetectionRecord(classDetailDTO);
}
@PostMapping("imageCheckDetail")
@ApiOperation("实名制验证详情 id 班级id userName pageSize pageNum")
@LoginRequired
public ResponseVO imageCheckDetail(@RequestBody ClassDetailDTO classDetailDTO){
return ResponseData.generateCreatedResponse(0,administerService.imageCheckDetail(classDetailDTO));
}
@PostMapping("exportZip")
@ApiOperation("下载压缩包 id 班级id")
@CrossOrigin
@LoginRequired
public void exportZip(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{
administerService.export(classDetailDTO);
}
@PostMapping("memberStudyLog")
@ApiOperation("学员学习日志 classId memberId")
@LoginRequired
public void memberStudyLog(@RequestBody MemberStudyLogDTO memberStudyLogDTO) throws Exception{
administerService.memberStudyLog(memberStudyLogDTO);
}
@PostMapping("importMember")
@ApiOperation("导入学生 {companyId 公司id file}")
@LoginRequired
public ResponseVO importMember(Long companyId,@RequestParam("file") MultipartFile file)throws Exception{
return ResponseData.generateCreatedResponse(0,administerService.importMember(companyId,file));
}
@PostMapping("manageMember")
@ApiOperation("用户管理 {pageSize pageNum userName:名字 【废弃】}")
@LoginRequired
public ResponseVO manageMember(@RequestBody ManageMemberDTO manageMemberDTO){
return ResponseData.generateCreatedResponse(0,administerService.manageMember(manageMemberDTO));
}
}