huanghongfa
2020-12-20 def38240262b4403377d4c16beac3ea048f1e658
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
package com.panzhihua.service_user.api;
 
import com.panzhihua.common.model.vos.MenuVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.service_user.service.RoleService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import javax.annotation.Resource;
import java.util.List;
 
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
 * @description: 权限
 * @author: huang.hongfa weixin hhf9596 qq 959656820
 * @create: 2020-11-25 15:57
 **/
@RestController
@RequestMapping("/role/")
public class RoleApi {
    @Resource
    private RoleService roleService;
 
    /**
     * 获取平台所有权限url
     * @return 所有权限url
     */
    @PostMapping("getAllMenu")
    public R<List<MenuVO>> getAllMenu(){
        return roleService.getAllMenu();
    }
 
    /**
     * 获取某个人的所有角色
     * @param username 用户ID
     * @return 所有角色
     */
    @PostMapping("getUserRoles")
    public R<List<String>> getUserRoles(@RequestParam("username") String username){
        return roleService.getUserRoles(username);
    }
 
    /**
     * 查询社区的党委角色
     * @param communityId 社区id
     * @return 党委角色列表
     */
    @PostMapping("listidentity")
    public R listIdentity(@RequestParam("communityId")Integer communityId){
        return roleService.listIdentity(communityId);
    }
}