IUserPrivilegeService.java 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package com.zy.bms.service;
  2. import com.zy.bms.entity.UserPrivilege;
  3. import com.baomidou.mybatisplus.extension.service.IService;
  4. import com.zy.bms.pojo.vo.GroupListVo;
  5. import java.util.List;
  6. import java.util.Map;
  7. /**
  8. * 用户查看手机设备权限表 服务类
  9. *
  10. * @author chenyi
  11. * @since 2021-07-13
  12. */
  13. public interface IUserPrivilegeService extends IService<UserPrivilege> {
  14. /**
  15. * 查询用户拥有权限的设备组
  16. *
  17. * @param userId 用户ID
  18. */
  19. List<String> getGroupIdsByUserId(Integer userId);
  20. /**
  21. * 通过用户Id 查询全部的设备组
  22. * 滤掉用户已有权限的设备组
  23. *
  24. * @param userId 用户ID
  25. */
  26. Map<String, List<GroupListVo>> getGroupByUserId(Integer userId);
  27. /**
  28. * 查询用户是否有某设备组的权限
  29. *
  30. * @param userId 用户ID
  31. * @param groupId 设备组
  32. */
  33. boolean hasPrivilege(Integer userId, String groupId);
  34. /**
  35. * 批量保存实体类
  36. *
  37. * @param userId 用户ID
  38. * @param groups 用户组
  39. */
  40. void saveBatch(Integer userId, String[] groups);
  41. }