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);
|
}
|
}
|