IRoleService.java 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are met:
  6. *
  7. * Redistributions of source code must retain the above copyright notice,
  8. * this list of conditions and the following disclaimer.
  9. * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * Neither the name of the dreamlu.net developer nor the names of its
  13. * contributors may be used to endorse or promote products derived from
  14. * this software without specific prior written permission.
  15. * Author: Chill 庄骞 (smallchill@163.com)
  16. */
  17. package org.springblade.modules.system.service;
  18. import com.baomidou.mybatisplus.core.metadata.IPage;
  19. import com.baomidou.mybatisplus.extension.service.IService;
  20. import org.springblade.modules.system.entity.Role;
  21. import org.springblade.modules.system.vo.RoleVO;
  22. import javax.validation.constraints.NotEmpty;
  23. import java.util.List;
  24. /**
  25. * 服务类
  26. *
  27. * @author Chill
  28. */
  29. public interface IRoleService extends IService<Role> {
  30. /**
  31. * 自定义分页
  32. *
  33. * @param page
  34. * @param role
  35. * @return
  36. */
  37. IPage<RoleVO> selectRolePage(IPage<RoleVO> page, RoleVO role);
  38. /**
  39. * 树形结构
  40. *
  41. * @param tenantId
  42. * @return
  43. */
  44. List<RoleVO> tree(String tenantId);
  45. /**
  46. * 权限配置
  47. *
  48. * @param roleIds 角色id集合
  49. * @param menuIds 菜单id集合
  50. * @param dataScopeIds 数据权限id集合
  51. * @param apiScopeIds 接口权限id集合
  52. * @return 是否成功
  53. */
  54. boolean grant(@NotEmpty List<Long> roleIds, List<Long> menuIds, List<Long> dataScopeIds, List<Long> apiScopeIds);
  55. /**
  56. * 获取角色ID
  57. *
  58. * @param tenantId
  59. * @param roleNames
  60. * @return
  61. */
  62. String getRoleIds(String tenantId, String roleNames);
  63. /**
  64. * 获取角色名
  65. *
  66. * @param roleIds
  67. * @return
  68. */
  69. List<String> getRoleNames(String roleIds);
  70. /**
  71. * 获取角色名
  72. *
  73. * @param roleIds
  74. * @return
  75. */
  76. List<String> getRoleAliases(String roleIds);
  77. /**
  78. * 提交
  79. *
  80. * @param role
  81. * @return
  82. */
  83. boolean submit(Role role);
  84. /**
  85. * 角色信息查询
  86. *
  87. * @param roleName
  88. * @param parentId
  89. * @return
  90. */
  91. List<RoleVO> search(String roleName, Long parentId);
  92. List<Role> getRolesByAlias(String roleAlias);
  93. }