tj
2025-06-05 2d549a04870d1315868a7cf19952b64e8071e711
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
package com.cloudroam.service;
 
import com.cloudroam.bo.GroupPermissionBO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cloudroam.common.enumeration.GroupLevelEnum;
import com.cloudroam.model.GroupDO;
 
import java.util.List;
 
/**
 * @author 
 * @author 
 * 分组服务接口
 */
public interface GroupService extends IService<GroupDO> {
 
    /**
     * 获得用户的所有分组
     *
     * @param userId 用户id
     * @return 所有分组
     */
    List<GroupDO> getUserGroupsByUserId(Integer userId);
 
    /**
     * 获得用户的所有分组id
     *
     * @param userId 用户id
     * @return 所有分组id
     */
    List<Integer> getUserGroupIdsByUserId(Integer userId);
 
    /**
     * 分页获取分组数据
     *
     * @param count 分页数量
     * @param page  那一页
     * @return 分组页
     */
    IPage<GroupDO> getGroupPage(int page, int count);
 
    /**
     * 通过id检查分组是否存在
     *
     * @param id 分组id
     * @return 是否存在
     */
    boolean checkGroupExistById(Integer id);
 
    /**
     * 获得分组及其权限
     *
     * @param id 分组id
     * @return 分组及权限
     */
    GroupPermissionBO getGroupAndPermissions(Integer id);
 
    /**
     * 通过名称检查分组是否存在
     *
     * @param name 分组名
     * @return 是否存在
     */
    boolean checkGroupExistByName(String name);
 
    /**
     * 检查该用户是否在root分组中
     *
     * @param userId 用户id
     * @return true表示在
     */
    boolean checkIsRootByUserId(Integer userId);
 
    /**
     * 删除用户与分组直接的关联
     *
     * @param userId    用户id
     * @param deleteIds 分组id
     */
    boolean deleteUserGroupRelations(Integer userId, List<Integer> deleteIds);
 
    /**
     * 添加用户与分组直接的关联
     *
     * @param userId 用户id
     * @param addIds 分组id
     */
    boolean addUserGroupRelations(Integer userId, List<Integer> addIds);
 
    /**
     * 获得分组下所有用户的id
     *
     * @param id 分组id
     * @return 用户id
     */
    List<Integer> getGroupUserIds(Integer id);
 
    /**
     * 通过分组级别获取超级管理员分组或游客分组
     *
     * @param level GroupLevelEnum 枚举类
     * @return 用户组
     */
    GroupDO getParticularGroupByLevel(GroupLevelEnum level);
 
    /**
     * 通过分组级别获取超级管理员分组或游客分组的id
     *
     * @param level GroupLevelEnum 枚举类
     * @return 用户组id
     */
    Integer getParticularGroupIdByLevel(GroupLevelEnum level);
 
}