guohongjin
2024-05-15 5b7639f0bd9e056738ec15100ed0532e965c6cd5
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
/*
 * Copyright [2020-2030] [https://www.stylefeng.cn]
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
 *
 * 1.请不要删除和修改根目录下的LICENSE文件。
 * 2.请不要删除和修改Guns源码头部的版权声明。
 * 3.请保留源码和相关描述文件的项目出处,作者声明等。
 * 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns
 * 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns
 * 6.若您的项目无法满足以上几点,可申请商业授权
 */
package cn.stylefeng.roses.kernel.system.api;
 
import cn.stylefeng.roses.kernel.auth.api.pojo.login.LoginUser;
import cn.stylefeng.roses.kernel.system.api.pojo.user.OAuth2AuthUserDTO;
import cn.stylefeng.roses.kernel.system.api.pojo.user.OnlineUserDTO;
import cn.stylefeng.roses.kernel.system.api.pojo.user.SysUserDTO;
import cn.stylefeng.roses.kernel.system.api.pojo.user.UserLoginInfoDTO;
import cn.stylefeng.roses.kernel.system.api.pojo.user.request.OnlineUserRequest;
import cn.stylefeng.roses.kernel.system.api.pojo.user.request.SysUserRequest;
 
import java.util.Date;
import java.util.List;
import java.util.Set;
 
/**
 * 用户管理服务接口
 *
 * @author fengshuonan
 * @date 2020/10/20 13:20
 */
public interface UserServiceApi {
 
    /**
     * 获取用户登录需要的详细信息(用在第一次获取登录用户)
     *
     * @param account 账号
     * @return 用户登录需要的详细信息
     * @author fengshuonan
     * @date 2020/10/20 16:59
     */
    UserLoginInfoDTO getUserLoginInfo(String account);
 
    /**
     * 获取刷新后的登录用户(用在用户登录之后调用)
     * <p>
     * 以往用户登录后直接从session缓存中获取用户信息,不能及时更新,需要退出才可以获取最新信息
     * <p>
     * 本方法解决了实时获取当前登录用户不准确的问题
     *
     * @author fengshuonan
     * @date 2021/7/29 22:03
     */
    LoginUser getEffectiveLoginUser(LoginUser loginUser);
 
    /**
     * 更新用户的登录信息,一般为更新用户的登录时间和ip
     *
     * @param userId 用户id
     * @param date   用户登录时间
     * @param ip     用户登录的ip
     * @author fengshuonan
     * @date 2020/10/21 14:13
     */
    void updateUserLoginInfo(Long userId, Date date, String ip);
 
    /**
     * 根据机构id集合删除对应的用户-数据范围关联信息
     *
     * @param organizationIds 组织架构id集合
     * @author fengshuonan
     * @date 2020/10/20 16:59
     */
    void deleteUserDataScopeListByOrgIdList(Set<Long> organizationIds);
 
    /**
     * 获取用户的角色id集合
     *
     * @param userId 用户id
     * @return 角色id集合
     * @author majianguo
     * @date 2020/11/5 下午3:57
     */
    List<Long> getUserRoleIdList(Long userId);
 
    /**
     * 根据角色id删除对应的用户-角色表关联信息
     *
     * @param roleId 角色id
     * @author majianguo
     * @date 2020/11/5 下午3:58
     */
    void deleteUserRoleListByRoleId(Long roleId);
 
    /**
     * 获取用户单独绑定的数据范围,sys_user_data_scope表中的数据范围
     *
     * @param userId 用户id
     * @return 用户数据范围
     * @author fengshuonan
     * @date 2020/11/21 12:15
     */
    List<Long> getUserBindDataScope(Long userId);
 
    /**
     * 获取在线用户列表
     *
     * @author fengshuonan
     * @date 2021/1/10 9:56
     */
    List<OnlineUserDTO> onlineUserList(OnlineUserRequest onlineUserRequest);
 
    /**
     * 根据用户ID获取用户信息
     *
     * @param userId 用户ID
     * @author majianguo
     * @date 2021/1/9 19:00
     */
    SysUserDTO getUserInfoByUserId(Long userId);
 
    /**
     * 根据用户ID列表获取用户信息集合
     *
     * @param userIdSet 用户id集合
     * @return 返回用户所有信息
     * @author fengshuonan
     * @date 2022/9/25 10:14
     */
    List<SysUserDTO> getUserInfoList(List<Long> userIdSet);
 
    /**
     * 查询全部用户ID(剔除被删除的)
     *
     * @param sysUserRequest 查询参数
     * @return List<Long> 用户id 集合
     * @author liuhanqing
     * @date 2021/1/4 22:09
     */
    List<Long> queryAllUserIdList(SysUserRequest sysUserRequest);
 
    /**
     * 根据用户id 判断用户是否存在
     *
     * @param userId 用户id
     * @return 用户信息
     * @author liuhanqing
     * @date 2021/1/4 22:55
     */
    Boolean userExist(Long userId);
 
    /**
     * 获取用户的头像url
     *
     * @author fengshuonan
     * @date 2021/12/29 17:27
     */
    String getUserAvatarUrlByUserId(Long userId);
 
    /**
     * 创建并保存OAuth2用户信息
     *
     * @author fengshuonan
     * @date 2022/7/1 19:03
     */
    SysUserDTO createAndSaveOAuth2User(OAuth2AuthUserDTO oAuth2AuthUserDTO);
 
}