This commit is contained in:
xiangwb
2017-11-15 14:06:09 +08:00
parent cbf6486631
commit 2e236d25b4
8 changed files with 41 additions and 103 deletions
@@ -183,23 +183,22 @@ public class SysUserControl {
}
@LogInfo("根据用户主键查找所拥有的角色")
@PostMapping("listRoles")
public JSONObject listRoles(@RequestParam String userId, @RequestParam String enable) {
@PostMapping("listRoleByUserId")
public JSONObject listRoleByUserId(@RequestParam String userId,String enable) {
if (StringUtils.isEmpty(userId))
return JSONObjResult.toJSONObj("用户主键不能为空");
if (StringUtils.isEmpty(enable))
return JSONObjResult.toJSONObj("是否启用不能为空");
// if (StringUtils.isEmpty(enable))
// return JSONObjResult.toJSONObj("是否启用不能为空");
List<SysRole> list = sysRoleService.listByUserIdEnable(userId, enable);
return JSONObjResult.toJSONObj(list, true, "");
}
@LogInfo("根据用户主键查找所拥有的权限")
@PostMapping("queryAuthority")
public JSONObject queryAuthority(@RequestParam String userId, @RequestParam String enable) {
@PostMapping("listAuthorityByUserId")
public JSONObject listAuthorityByUserId(@RequestParam String userId,String enable) {
if (StringUtils.isEmpty(userId))
return JSONObjResult.toJSONObj("用户主键不能为空");
List<SysAuthority> list = sysUserService.queryAuthority(userId,
enable);
List<SysAuthority> list = sysUserService.queryAuthority(userId, enable);
return JSONObjResult.toJSONObj(list, true, "");
}
}