SysPermissionExtController.java
3.2 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
package com.skua.modules.system.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.skua.core.api.vo.Result;
import com.skua.modules.system.entity.SysPermissionExt;
import com.skua.modules.system.service.ISysPermissionExtService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* <pre>
* 菜单权限扩展配置
* </pre>
* @author 谢超
* @version V1.0, 2022-06-16 14:44:41
*/
@Slf4j
@Api(tags="菜单权限扩展配置")
@RestController
@RequestMapping("/system/sysPermissionExt")
public class SysPermissionExtController {
@Autowired
private ISysPermissionExtService sysPermissionExtService;
/**
* <pre>
* 更新机构信息
* </pre>
* @param sysPermissionDepartConfigId
* @param sysPermissionIds
* @author Xie Chao,2022-06-16 17:53
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@GetMapping("/updateSysPermissionExt")
public Result<String> updateSysPermissionExt(String sysPermissionDepartConfigId, String sysPermissionIds){
Result<String> result = new Result<>();
sysPermissionExtService.updateSysPermissionExt(sysPermissionDepartConfigId,sysPermissionIds);
result.setResult("更新成功");
result.setSuccess(true);
return result;
}
/**
* <pre>
* 查询已选择的权限ID
* </pre>
* @param sysPermissionDepartConfigId
* @author Xie Chao,2022-06-16 18:13
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@GetMapping("/getSelectedPermission")
public Result<List<String>> getSelectedPermission(String sysPermissionDepartConfigId){
Result<List<String>> result = new Result<>();
List<String> sysPermissionIdList = new ArrayList<>();
QueryWrapper<SysPermissionExt> sysPermissionExtQueryWrapper = new QueryWrapper<>();
if (!StringUtils.isBlank(sysPermissionDepartConfigId)){
sysPermissionExtQueryWrapper.eq("sys_permission_depart_config_id",sysPermissionDepartConfigId);
}
List<SysPermissionExt> list = sysPermissionExtService.list(sysPermissionExtQueryWrapper);
for (SysPermissionExt sysPermissionExt : list) {
sysPermissionIdList.add(sysPermissionExt.getSysPermissionId());
}
result.setResult(sysPermissionIdList);
result.setSuccess(true);
return result;
}
/**
* <pre>
* 通过菜单ID查询菜单机构配置
* </pre>
* @param sysPermissionId
* @author Xie Chao,2022-06-16 18:13
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
@GetMapping("/getSysPermissionDepartConfigBySysPermissionId")
public Result<Map<String,String>> getSysPermissionDepartConfigBySysPermissionId(String sysPermissionId){
Result<Map<String,String>> result = new Result<>();
Map<String,String> resultMap = sysPermissionExtService.getSysPermissionDepartConfigBySysPermissionId(sysPermissionId);
result.setResult(resultMap);
result.setSuccess(true);
return result;
}
}