MemberController.java
5.03 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
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.VerifyCodeDTO;
import com.subsidy.dto.member.AddMemberDTO;
import com.subsidy.dto.member.ContentMemberDTO;
import com.subsidy.dto.member.GetAllDTO;
import com.subsidy.dto.member.StudyHistoryDTO;
import com.subsidy.model.MemberDO;
import com.subsidy.service.MemberService;
import com.subsidy.util.ConstantUtils;
import com.subsidy.vo.member.ContentVodVO;
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 DengMin
* @since 2021-10-11
*/
@RestController
@Api(tags = "学生表")
@RequestMapping("/member")
public class MemberController {
@Autowired
private MemberService memberService;
@PostMapping("getAll")
@ApiOperation("查询某部门成员 pageNum pageSize departmentId userName status")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO getAll(@RequestBody GetAllDTO getAllDTO){
return ResponseData.generateCreatedResponse(0,memberService.getAll(getAllDTO));
}
@PostMapping("deleteMember")
@ApiOperation("删除成员 id ")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO deleteMember(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,memberService.deleteMember(memberDO));
}
@PostMapping("addMember")
@ApiOperation("新增成员 departmentId userName accountName telephone gender image idCard")
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO addMember(@RequestBody AddMemberDTO addMemberDTO){
return ResponseData.generateCreatedResponse(0,memberService.addMember(addMemberDTO));
}
@PostMapping("updateMember")
@ApiOperation("编辑成员 {id departmentId userName accountName telephone gender image idCard status}")
//@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public ResponseVO updateMember(@RequestBody AddMemberDTO addMemberDTO){
return ResponseData.generateCreatedResponse(0,memberService.updateMember(addMemberDTO));
}
@PostMapping(value = "/login")
@ApiOperation("手机端:登录:telephone/手机号, verifyCode/验证码")
public ResponseVO login(@RequestBody VerifyCodeDTO verifyCodeDTO) {
return ResponseData.generateCreatedResponse(0, memberService.login(verifyCodeDTO));
}
@PostMapping("passwordLogin")
@ApiOperation("手机端:密码登录 {accountName password}")
public ResponseVO passwordLogin(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,memberService.passwordLogin(memberDO));
}
@PostMapping("updatePassword")
@ApiOperation("修改密码 {id password}")
public ResponseVO updatePassword(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,memberService.updatePassword(memberDO));
}
@PostMapping("studyPage")
@ApiOperation("手机端:学习主页 id 学员id")
public ResponseVO studyPage(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,memberService.studyPage(memberDO));
}
@PostMapping("contentVod")
@ApiOperation("手机端:目录+视频 courseId 课程 memberId 学员id")
public ResponseVO contentVod(@RequestBody ContentMemberDTO contentVodDTO){
return ResponseData.generateCreatedResponse(0,memberService.contentVod(contentVodDTO));
}
@PostMapping("contentFiles")
@ApiOperation("手机端:目录+课件 courseId 课程 memberId 学员id")
public ResponseVO contentFiles(@RequestBody ContentMemberDTO contentMemberDTO){
return ResponseData.generateCreatedResponse(0,memberService.contentFiles(contentMemberDTO));
}
@PostMapping("studyHistory")
@ApiOperation("学习记录 id 成员id pageSize pageNum")
public ResponseVO studyHistory(@RequestBody StudyHistoryDTO studyHistoryDTO){
return ResponseData.generateCreatedResponse(0,memberService.studyHistory(studyHistoryDTO));
}
@PostMapping("getCourseTest")
@ApiOperation("获取课程下的测试情况 {memberId 成员id courseId 课程id classId}")
public ResponseVO getCourseTest(@RequestBody ContentMemberDTO contentMemberDTO){
return ResponseData.generateCreatedResponse(0,memberService.getCourseTest(contentMemberDTO));
}
@PostMapping("getStudyInfo")
@ApiOperation("获取学生完成课程情况 id 学员id")
public ResponseVO getStudyInfo(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,memberService.getStudyInfo(memberDO));
}
}