罗元桥
2021-09-27 5f349fe34e3e33625f8593ec1b616f0c4528a12c
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/RoleServiceImpl.java
@@ -6,6 +6,8 @@
import javax.annotation.Resource;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.BeanUtils;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
@@ -106,19 +108,12 @@
     * @return 角色集合
     */
    @Override
    public R listRoleBackstage(Long communityId) {
        List<SysRoleDO> sysRoleDOS =
            roleDAO.selectList(new QueryWrapper<SysRoleDO>().lambda().eq(SysRoleDO::getCommunityId, communityId));
        if (ObjectUtils.isEmpty(sysRoleDOS)) {
    public R listRoleBackstage(Long communityId,Integer pageNum,Integer pageSize) {
        IPage<SysRoleDO> sysRoleDOIPage=this.roleDAO.selectPage(new Page<>(pageNum,pageSize),new QueryWrapper<SysRoleDO>().lambda().eq(SysRoleDO::getCommunityId, communityId).orderByDesc(SysRoleDO::getCreateAt));
        if (ObjectUtils.isEmpty(sysRoleDOIPage.getRecords())) {
            return R.fail("角色列表为空");
        }
        List<RoleVO> roleVOS = new ArrayList<>();
        sysRoleDOS.forEach(sysRoleDO -> {
            RoleVO roleVO = new RoleVO();
            BeanUtils.copyProperties(sysRoleDO, roleVO);
            roleVOS.add(roleVO);
        });
        return R.ok(roleVOS);
        return R.ok(sysRoleDOIPage);
    }
    /**