feat;增加角色模块

This commit is contained in:
曾文豪
2024-06-25 18:51:29 +08:00
parent a10b57f6fc
commit aee4fa86f6
3 changed files with 18 additions and 16 deletions

View File

@@ -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("");
} }

View File

@@ -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;

View File

@@ -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>