fixed:部分调用不存在的问题

This commit is contained in:
godchao 2019-08-07 15:45:41 +08:00
parent 4ee61a5a72
commit 4c1de693e0
4 changed files with 9 additions and 18 deletions

View File

@ -180,9 +180,7 @@ public class DepartmentController extends BaseCrudRestController {
* 根据组织ID获取部门list
* */
@GetMapping("/getDepartmentList/{orgId}")
public JsonResult getDepartmentList(@PathVariable Long orgId, HttpServletRequest request) throws Exception {
// 构建分页
Pagination pagination = buildPagination(request);
public JsonResult getDepartmentList(@PathVariable Long orgId, Pagination pagination, HttpServletRequest request) throws Exception {
Wrapper wrapper = new QueryWrapper<Department>()
.lambda()
.eq(Department::getOrgId, orgId);

View File

@ -14,10 +14,12 @@ import com.diboot.core.vo.Pagination;
import com.diboot.core.vo.Status;
import com.diboot.example.entity.Department;
import com.diboot.example.entity.SysUser;
import com.diboot.example.entity.User;
import com.diboot.example.service.DepartmentService;
import com.diboot.example.service.SysUserService;
import com.diboot.example.vo.SysUserListVO;
import com.diboot.example.vo.SysUserVO;
import com.diboot.example.vo.UserVO;
import com.diboot.shiro.authz.annotation.AuthorizationPrefix;
import com.diboot.shiro.authz.annotation.AuthorizationWrapper;
import com.diboot.shiro.entity.Permission;
@ -62,16 +64,9 @@ public class SysUserController extends BaseCrudRestController {
@GetMapping("/list")
@AuthorizationWrapper(value = @RequiresPermissions("list"), name = "列表")
public JsonResult getVOList(HttpServletRequest request) throws Exception{
QueryWrapper<SysUser> queryWrapper = buildQuery(request);
// 构建分页
Pagination pagination = buildPagination(request);
// 查询当前页的Entity主表数据
List<SysUserVO> voList = sysUserService.getSysUserList(queryWrapper, pagination);
//筛选出在列表页展示的字段
List<SysUserListVO> userVoList = RelationsBinder.convertAndBind(voList, SysUserListVO.class);
// 返回结果
return new JsonResult(Status.OK, userVoList).bindPagination(pagination);
public JsonResult getVOList(SysUser sysUser, Pagination pagination, HttpServletRequest request) throws Exception{
QueryWrapper<User> queryWrapper = super.buildQueryWrapper(sysUser);
return super.getVOListWithPaging(queryWrapper, pagination, UserVO.class);
}
/***

View File

@ -18,7 +18,7 @@ public class MemoryCondition implements Condition {
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
//获取配置信息
Boolean enableCached = context.getEnvironment().getProperty(AuthCacheProperties.CACHE_PREFIX + ".permission-caching-enabled", Boolean.class);
enableCached = enableCached == null ? false : enableCached;
enableCached = enableCached == null ? true : enableCached;
AuthCacheProperties.CacheWay cacheWay = context.getEnvironment().getProperty(AuthCacheProperties.CACHE_PREFIX + ".cache-way", AuthCacheProperties.CacheWay.class);
cacheWay = cacheWay == null ? AuthCacheProperties.CacheWay.MEMORY : cacheWay;
return enableCached && AuthCacheProperties.CacheWay.MEMORY.equals(cacheWay);

View File

@ -50,10 +50,8 @@ public class RoleController extends BaseCrudRestController {
@GetMapping("/list")
@AuthorizationWrapper(value = @RequiresPermissions("list"), name = "列表")
@AuthorizationCache
public JsonResult getVOList(HttpServletRequest request) throws Exception{
QueryWrapper<Role> queryWrapper = buildQuery(request);
// 构建分页
Pagination pagination = buildPagination(request);
public JsonResult getVOList(HttpServletRequest request, Pagination pagination) throws Exception{
QueryWrapper<Role> queryWrapper = buildQueryWrapper(request);
// 获取结果
List<RoleVO> voList = roleService.getRoleList(queryWrapper, pagination);
// 返回结果