AdministerController.java
3.52 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
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.common.interceptor.TimeRequired;
import com.subsidy.dto.administer.AddAdministerDTO;
import com.subsidy.dto.administer.DownloadFailMembersDTO;
import com.subsidy.model.AdministerDO;
import com.subsidy.model.MemberDO;
import com.subsidy.service.AdministerService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
import org.springframework.web.multipart.MultipartFile;
/**
* <p>
* 管理平台用户 前端控制器
* </p>
*
* @author Tuyp
* @since 2024-01-11
*/
@RestController
@Api(tags = "管理平台用户")
@RequestMapping("/administer")
public class AdministerController {
@Autowired
private AdministerService administerService;
@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("auth")
@ApiOperation("授权到应用端免密登录 accountName 用户名 id ")
@TimeRequired
public ResponseVO qxy(@RequestBody AdministerDO administerDO){
return ResponseData.generateCreatedResponse(0,administerService.auth(administerDO));
}
@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("downloadFailMembers")
@ApiOperation("下载失败的学员 importMemberVOS[] 字段是导出失败的字段")
public void downloadFailMembers(@RequestBody DownloadFailMembersDTO downloadFailMembersDTO){
administerService.downloadFailMembers(downloadFailMembersDTO);
}
@PostMapping("addAdminister")
@ApiOperation("添加客户账户 userName 名称 accountName 账户 password 密码 telephone 联系方式 role:0:应用 1:客户 2:中心 3:企业唯一账号 remark 备注 companyIds[] serviceIds[]")
@LoginRequired
public ResponseVO addAdminister(@RequestBody AddAdministerDTO addAdministerDTO) {
return ResponseData.generateCreatedResponse(0, administerService.addAdminister(addAdministerDTO));
}
@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 remark telephone companyIds[] serviceIds[]")
@LoginRequired
public ResponseVO updateAdminister(@RequestBody AddAdministerDTO addAdministerDTO) {
return ResponseData.generateCreatedResponse(0, administerService.updateAdminister(addAdministerDTO));
}
}