feat;增加角色模块
This commit is contained in:
@@ -264,8 +264,6 @@ public class RoleController {
|
|||||||
@GetMapping("/owner/menu")
|
@GetMapping("/owner/menu")
|
||||||
public ApiResp<String> ownerMenu(@Valid ServiceDTO dto) {
|
public ApiResp<String> ownerMenu(@Valid ServiceDTO dto) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return ApiResp.respOK("");
|
return ApiResp.respOK("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,10 +62,8 @@ public class CoreRoleService extends TsServiceBase<CoreRoleGroupMapper, CoreRole
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<CoreRoleAuthority> getAllOwnerMenus(String userId,String roleId) {
|
public List<CoreRoleAuthority> getAllOwnerMenus(String userId, String roleId) {
|
||||||
List<CoreRoleAuthority> authority = coreRoleUserMapper.getAllAuthorityByUserId(userId, "");
|
List<CoreRoleAuthority> authority = coreRoleUserMapper.getAllAuthorityByUserId(userId, roleId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return authority;
|
return authority;
|
||||||
|
|||||||
@@ -35,18 +35,23 @@
|
|||||||
<select id="getAllAuthorityByUserId" resultType="com.tiesheng.role.pojos.dao.CoreRoleAuthority">
|
<select id="getAllAuthorityByUserId" resultType="com.tiesheng.role.pojos.dao.CoreRoleAuthority">
|
||||||
select *
|
select *
|
||||||
from core_role_authority
|
from core_role_authority
|
||||||
where id in (select type_id
|
where is_open = 1
|
||||||
from core_role_user
|
and is_deleted = 0
|
||||||
where type = 'menu'
|
and
|
||||||
and user_id = #{userId}
|
id in (select type_id
|
||||||
|
from core_role_user
|
||||||
|
where type = 'menu'
|
||||||
|
and user_id = #{userId}
|
||||||
|
and is_deleted = 0
|
||||||
|
|
||||||
union
|
union
|
||||||
|
|
||||||
select crgr.menu_id
|
select crgr.menu_id
|
||||||
from core_role_user cru
|
from core_role_user cru
|
||||||
left join core_role_group_rx crgr on crgr.group_id = cru.type_id
|
left join core_role_group_rx crgr on crgr.group_id = cru.type_id
|
||||||
where type = 'job'
|
where type = 'job'
|
||||||
and user_id = #{userId}
|
and user_id = #{userId}
|
||||||
|
and cru.is_deleted = 0
|
||||||
|
|
||||||
|
|
||||||
<if test="roleId != null and roleId != ''">
|
<if test="roleId != null and roleId != ''">
|
||||||
@@ -57,6 +62,7 @@
|
|||||||
where group_id = #{roleId}
|
where group_id = #{roleId}
|
||||||
</if>
|
</if>
|
||||||
)
|
)
|
||||||
|
order by sort
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user