das接口新增
This commit is contained in:
parent
5a2eb8e6ad
commit
04f383191d
@ -57,4 +57,9 @@ public class SysRoleController {
|
|||||||
public PageDataInfo<SysRole> queryRoleList(@RequestBody SysRoleQueryDto sysRoleQueryDto, PageQuery pageQuery) {
|
public PageDataInfo<SysRole> queryRoleList(@RequestBody SysRoleQueryDto sysRoleQueryDto, PageQuery pageQuery) {
|
||||||
return sysRoleService.queryRoleList(sysRoleQueryDto, pageQuery);
|
return sysRoleService.queryRoleList(sysRoleQueryDto, pageQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/queryAuthorityById")
|
||||||
|
public R<?> queryAuthorityById(@RequestBody SysRoleQueryDto sysRoleQueryDto) {
|
||||||
|
return R.success(sysRoleService.queryAuthorityById(sysRoleQueryDto));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,4 +8,6 @@ import java.io.Serializable;
|
|||||||
public class SysRoleQueryDto implements Serializable {
|
public class SysRoleQueryDto implements Serializable {
|
||||||
/** 角色名称 */
|
/** 角色名称 */
|
||||||
private String roleName ;
|
private String roleName ;
|
||||||
|
|
||||||
|
private String roleId ;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.das.modules.auth.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号信息
|
||||||
|
*
|
||||||
|
* @author guchengwei
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SysRoleAuthVo implements Serializable {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
/**
|
||||||
|
* 账号ID
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 权限编码
|
||||||
|
*/
|
||||||
|
private String authorityCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 权限名称
|
||||||
|
*/
|
||||||
|
private String authorityName;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -3,9 +3,12 @@ package com.das.modules.auth.mapper;
|
|||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.das.modules.auth.domain.dto.SysRoleQueryDto;
|
import com.das.modules.auth.domain.dto.SysRoleQueryDto;
|
||||||
|
import com.das.modules.auth.domain.vo.SysRoleAuthVo;
|
||||||
import com.das.modules.auth.entity.SysRole;
|
import com.das.modules.auth.entity.SysRole;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 用户信息 Mapper 接口
|
* 用户信息 Mapper 接口
|
||||||
@ -23,4 +26,6 @@ public interface SysRoleMapper extends BaseMapper<SysRole> {
|
|||||||
*/
|
*/
|
||||||
long existRoleByRoleCode(@Param("roleCode") String roleCode);
|
long existRoleByRoleCode(@Param("roleCode") String roleCode);
|
||||||
IPage<SysRole> queryRoleList(IPage<SysRole> page, @Param("sysRole") SysRoleQueryDto sysRoleQueryDto);
|
IPage<SysRole> queryRoleList(IPage<SysRole> page, @Param("sysRole") SysRoleQueryDto sysRoleQueryDto);
|
||||||
|
|
||||||
|
List<SysRoleAuthVo> queryAuthorityById(@Param("id")Long id);
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,11 @@ package com.das.modules.auth.service;
|
|||||||
import com.das.common.utils.PageDataInfo;
|
import com.das.common.utils.PageDataInfo;
|
||||||
import com.das.common.utils.PageQuery;
|
import com.das.common.utils.PageQuery;
|
||||||
import com.das.modules.auth.domain.dto.*;
|
import com.das.modules.auth.domain.dto.*;
|
||||||
|
import com.das.modules.auth.domain.vo.SysRoleAuthVo;
|
||||||
import com.das.modules.auth.entity.SysRole;
|
import com.das.modules.auth.entity.SysRole;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface SysRoleService {
|
public interface SysRoleService {
|
||||||
SysRoleDto createRole(SysRoleDto sysRoleDto);
|
SysRoleDto createRole(SysRoleDto sysRoleDto);
|
||||||
|
|
||||||
@ -13,4 +16,6 @@ public interface SysRoleService {
|
|||||||
int deleteRole(DeleteDto deleteDto);
|
int deleteRole(DeleteDto deleteDto);
|
||||||
|
|
||||||
PageDataInfo<SysRole> queryRoleList(SysRoleQueryDto sysRoleQueryDto, PageQuery pageQuery);
|
PageDataInfo<SysRole> queryRoleList(SysRoleQueryDto sysRoleQueryDto, PageQuery pageQuery);
|
||||||
|
|
||||||
|
List<SysRoleAuthVo> queryAuthorityById(SysRoleQueryDto sysRoleQueryDto);
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ import com.das.common.utils.SequenceUtils;
|
|||||||
import com.das.modules.auth.domain.dto.DeleteDto;
|
import com.das.modules.auth.domain.dto.DeleteDto;
|
||||||
import com.das.modules.auth.domain.dto.SysRoleDto;
|
import com.das.modules.auth.domain.dto.SysRoleDto;
|
||||||
import com.das.modules.auth.domain.dto.SysRoleQueryDto;
|
import com.das.modules.auth.domain.dto.SysRoleQueryDto;
|
||||||
|
import com.das.modules.auth.domain.vo.SysRoleAuthVo;
|
||||||
import com.das.modules.auth.entity.SysRole;
|
import com.das.modules.auth.entity.SysRole;
|
||||||
import com.das.modules.auth.entity.SysRoleAuthority;
|
import com.das.modules.auth.entity.SysRoleAuthority;
|
||||||
import com.das.modules.auth.mapper.SysAuthorityMapper;
|
import com.das.modules.auth.mapper.SysAuthorityMapper;
|
||||||
@ -124,4 +125,9 @@ public class SysRoleServiceImpl implements SysRoleService {
|
|||||||
IPage<SysRole> iPage = sysRoleMapper.queryRoleList(pageQuery.build(), sysRoleQueryDto);
|
IPage<SysRole> iPage = sysRoleMapper.queryRoleList(pageQuery.build(), sysRoleQueryDto);
|
||||||
return PageDataInfo.build(iPage.getRecords(), iPage.getTotal());
|
return PageDataInfo.build(iPage.getRecords(), iPage.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SysRoleAuthVo> queryAuthorityById(SysRoleQueryDto sysRoleQueryDto) {
|
||||||
|
return sysRoleMapper.queryAuthorityById(Long.valueOf(sysRoleQueryDto.getRoleId()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,4 +27,9 @@
|
|||||||
select count(1) from sys_role t where t.role_code=#{roleCode}
|
select count(1) from sys_role t where t.role_code=#{roleCode}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="queryAuthorityById" resultType="com.das.modules.auth.domain.vo.SysRoleAuthVo">
|
||||||
|
select sa.id, sa.authority_code as authorityCode, sa.authority_name as authorityName from sys_authority sa left join sys_r_role_authority srra on sa.id = srra.authority_id
|
||||||
|
where srra.role_id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Loading…
Reference in New Issue
Block a user