merge
This commit is contained in:
@@ -10,6 +10,7 @@ import com.xwbing.service.SysAuthorityService;
|
||||
import com.xwbing.util.JSONObjResult;
|
||||
import com.xwbing.util.RestMessage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -71,6 +72,7 @@ public class SysAuthorityControl {
|
||||
|
||||
@LogInfo("根据父节点查询子节点(非递归)")
|
||||
@GetMapping("listByParentId")
|
||||
@ApiImplicitParam(name = "parentId", value = "父id,可为空", paramType = "query", dataType = "string")
|
||||
public JSONObject listByParentId(String parentId) {
|
||||
if (StringUtils.isEmpty(parentId))
|
||||
parentId = CommonConstant.ROOT;
|
||||
@@ -81,16 +83,16 @@ public class SysAuthorityControl {
|
||||
}
|
||||
|
||||
@LogInfo("根据是否启用查询所有权限")
|
||||
@GetMapping("listAuthorityByEnable")
|
||||
public JSONObject listAuthorityByEnable(String enable) {
|
||||
// if (StringUtils.isEmpty(enable))
|
||||
// return JSONObjResult.toJSONObj("是否启用不能为空");
|
||||
@GetMapping("listByEnable")
|
||||
@ApiImplicitParam(name = "enable", value = "是否启用,格式Y|N", paramType = "query", dataType = "string")
|
||||
public JSONObject listByEnable(String enable) {
|
||||
List<SysAuthority> authoritys = sysAuthorityService.listByEnable(enable);
|
||||
return JSONObjResult.toJSONObj(authoritys, true, "");
|
||||
}
|
||||
|
||||
@LogInfo("递归查询所有权限")
|
||||
@GetMapping("queryTree")
|
||||
@ApiImplicitParam(name = "enable", value = "是否启用,格式Y|N", paramType = "query", dataType = "string")
|
||||
public JSONObject queryTree(String enable) {
|
||||
List<SysAuthVo> authoritys = sysAuthorityService.queryAllChildren(CommonConstant.ROOT, enable);
|
||||
return JSONObjResult.toJSONObj(authoritys, true, "");
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.xwbing.service.SysRoleService;
|
||||
import com.xwbing.util.JSONObjResult;
|
||||
import com.xwbing.util.RestMessage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -73,6 +74,7 @@ public class SysRoleControl {
|
||||
|
||||
@LogInfo("根据角色主键查找权限")
|
||||
@PostMapping("listAuthorityByRoleId")
|
||||
@ApiImplicitParam(name = "enable", value = "是否启用,格式Y|N", paramType = "query",dataType = "string")
|
||||
public JSONObject listAuthorityByRoleId(@RequestParam String roleId, String enable) {
|
||||
if (StringUtils.isEmpty(roleId))
|
||||
return JSONObjResult.toJSONObj("角色主键不能为空");
|
||||
@@ -106,10 +108,9 @@ public class SysRoleControl {
|
||||
}
|
||||
|
||||
@LogInfo("根据是否启用查询所有角色")
|
||||
@GetMapping("listAllByEnable")
|
||||
public JSONObject listAllByEnable(String enable) {
|
||||
// if (StringUtils.isEmpty(enable))
|
||||
// return JSONObjResult.toJSONObj("是否启用不能为空");
|
||||
@GetMapping("listByEnable")
|
||||
@ApiImplicitParam(name = "enable", value = "是否启用,格式Y|N", paramType = "query",dataType = "string")
|
||||
public JSONObject listByEnable(String enable) {
|
||||
List<SysRole> sysRoles = sysRoleService.listAllByEnable(enable);
|
||||
return JSONObjResult.toJSONObj(sysRoles, true, "");
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.xwbing.util.CommonDataUtil;
|
||||
import com.xwbing.util.JSONObjResult;
|
||||
import com.xwbing.util.RestMessage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -136,7 +137,7 @@ public class SysUserControl {
|
||||
SysUser sysUser = sysUserService.getOne((String) CommonDataUtil.getToken(CommonConstant.CURRENT_USER_ID));
|
||||
if (sysUser == null)
|
||||
return JSONObjResult.toJSONObj("未获取到当前登录用户信息");
|
||||
List<SysAuthority> other = new ArrayList<>();
|
||||
List<SysAuthority> button = new ArrayList<>();
|
||||
List<SysAuthority> menu = new ArrayList<>();
|
||||
List<SysAuthority> list;
|
||||
if (CommonEnum.YesOrNoEnum.YES.getCode().equalsIgnoreCase(sysUser.getAdmin()))
|
||||
@@ -148,11 +149,11 @@ public class SysUserControl {
|
||||
if (sysAuthority.getType() == CommonEnum.MenuOrButtonEnum.MENU.getCode())
|
||||
menu.add(sysAuthority);
|
||||
else
|
||||
other.add(sysAuthority);
|
||||
button.add(sysAuthority);
|
||||
}
|
||||
}
|
||||
sysUser.setMenuArray(menu);
|
||||
sysUser.setOtherArray(other);
|
||||
sysUser.setButtonArray(button);
|
||||
return JSONObjResult.toJSONObj(sysUser, true, "");
|
||||
}
|
||||
|
||||
@@ -184,17 +185,17 @@ public class SysUserControl {
|
||||
|
||||
@LogInfo("根据用户主键查找所拥有的角色")
|
||||
@PostMapping("listRoleByUserId")
|
||||
public JSONObject listRoleByUserId(@RequestParam String userId,String enable) {
|
||||
@ApiImplicitParam(name = "enable", value = "是否启用,格式Y|N", paramType = "query",dataType = "string")
|
||||
public JSONObject listRoleByUserId(@RequestParam String userId, String enable) {
|
||||
if (StringUtils.isEmpty(userId))
|
||||
return JSONObjResult.toJSONObj("用户主键不能为空");
|
||||
// if (StringUtils.isEmpty(enable))
|
||||
// return JSONObjResult.toJSONObj("是否启用不能为空");
|
||||
List<SysRole> list = sysRoleService.listByUserIdEnable(userId, enable);
|
||||
return JSONObjResult.toJSONObj(list, true, "");
|
||||
}
|
||||
|
||||
@LogInfo("根据用户主键查找所拥有的权限")
|
||||
@PostMapping("listAuthorityByUserId")
|
||||
@ApiImplicitParam(name = "enable", value = "是否启用,格式Y|N", paramType = "query",dataType = "string")
|
||||
public JSONObject listAuthorityByUserId(@RequestParam String userId,String enable) {
|
||||
if (StringUtils.isEmpty(userId))
|
||||
return JSONObjResult.toJSONObj("用户主键不能为空");
|
||||
|
||||
Reference in New Issue
Block a user