IUser.java
5.68 KB
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
package com.dituhui.pea.user;
import com.dituhui.pea.common.PageResult;
import com.dituhui.pea.common.Result;
import com.dituhui.pea.enums.ThirdPartyEnum;
import com.dituhui.pea.pojo.*;
import com.dituhui.pea.pojo.user.OrgInfo;
import com.dituhui.pea.pojo.user.UserMenuSettingInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 用户相关接口
*
* @author
*/
@FeignClient(value = "project-user", contextId = "user")
public interface IUser {
/**
* 登录接口
*
* @param user
* @return
*/
@RequestMapping(value = "/pea-user/login", method = RequestMethod.POST)
public Result<UserLoginDTO> userLogin(@RequestBody UserLoginParam user);
/**
* 获取用户信息
*
* @param userId
* @return
*/
@RequestMapping(value = "/pea-user/userInfo", method = RequestMethod.GET)
public Result<UserLoginDTO> getUserInfo(@RequestHeader(name = "userId", required = true) String userId);
/**
* 刷新appkey接口<br>
* 初始化系统ak缓存,例如系统上线,新ak入库的时候
*
* @return
*/
@RequestMapping(value = "/pea-user/refreshAppkey", method = RequestMethod.POST)
public Result<Boolean> refreshAppkey();
/**
* 获取指定ak 并刷新所有ak至redis
*
* @param key ak值
* @return ak 对应的密钥等信息
*/
@GetMapping("/pea-user/appkey")
AppDTO getAppKeyInfo(@RequestParam(name = "key") String key);
/**
* 获取当前登陆用户信息
*
* @param token 登录token
* @param needTeamInfo 是否返回团队信息
* @return
*/
@RequestMapping(value = "/pea-user/getCurrentUserInfo", method = RequestMethod.GET)
WebResult<UserInfo> getCurrentUserInfo(@RequestParam(name = "userToken") String userToken,
@RequestParam(name = "needTeamInfo", required = false) Boolean needTeamInfo);
/**
* 获取用户信息
*
* @param id 用户ID
* @return
*/
@RequestMapping(value = "/pea-user/get", method = RequestMethod.GET)
WebResult<UserInfo> queryUserById(@RequestParam("id") String id);
/**
* 获取用户信息
*
* @param account 用户账号
* @return
*/
@RequestMapping(value = "/pea-user/getByAccount", method = RequestMethod.GET)
WebResult<UserInfo> queryUserByAccount(@RequestParam("account") String account);
/**
* 获取用户信息
*
* @param phone 用户电话
* @return
*/
@RequestMapping(value = "/pea-user/getByPhone", method = RequestMethod.GET)
WebResult<UserInfo> queryUserByPhone(@RequestParam("phone") String phone);
/**
* 获取用户信息
*
* @param id 第三方标志
* @param type 第三方类型
* @return
*/
@RequestMapping(value = "/pea-user/getByThirdParty", method = RequestMethod.GET)
WebResult<UserInfo> queryUserByThirdParty(@RequestParam("id") String id, @RequestParam("type") ThirdPartyEnum type);
/**
* 添加用户
*
* @param userInfo 用户信息
* @return
*/
@RequestMapping(value = "/pea-user/add", method = RequestMethod.POST)
Result<UserInfo> addUser(@RequestBody UserInfo userInfo);
/**
* 更新用户
*
* @param userInfo 用户信息
* @return
*/
@RequestMapping(value = "/pea-user/update", method = RequestMethod.POST)
Result<UserInfo> updateUser(@RequestBody UserInfo userInfo);
/**
* 删除用户
*
* @param userId 用户ID
* @return
*/
@RequestMapping(value = "/pea-user/delete", method = RequestMethod.POST)
Result<Boolean> deleteUser(@RequestBody UserInfoSearch search);
/**
* 注册用户
*
* @param userInfo 用户信息
* @return
*/
@RequestMapping(value = "/pea-user/register", method = RequestMethod.POST)
WebResult<UserInfo> register(@RequestBody UserInfo userInfo);
/**
* 第三方用户注册
*
* @param thirdUserInfo 第三方用户信息
* @return
*/
@RequestMapping(value = "/pea-user/thirdRegister", method = RequestMethod.POST)
WebResult<UserInfo> thirdRegister(@RequestBody ThirdUserInfo thirdUserInfo);
/**
* 用户列表
*
* @param search 查询条件
* @return
*/
@RequestMapping(value = "/pea-user/list", method = RequestMethod.GET)
Result<PageResult<UserInfoSearch>> list(UserInfoSearch search);
/**
* 禁用用户
*
* @param search 查询条件
* @return
*/
@RequestMapping(value = "/pea-user/ban", method = RequestMethod.POST)
Result<Boolean> ban(@RequestBody UserInfoSearch search);
/**
* 获取用户组织
*
* @param userId 查询条件
* @return
*/
@RequestMapping(value = "/pea-user/orgs", method = RequestMethod.GET)
Result<List<OrgInfo>> orgs(@RequestParam("userId") String userId);
/**
* 获取用户组织
*
* @param userId 查询条件
* @return
*/
@RequestMapping(value = "/pea-user/orgsNoName", method = RequestMethod.GET)
Result<List<OrgInfo>> orgsNoName(@RequestParam("userId") String userId);
/**
* 获取用户组织
*
* @param userId 查询条件
* @return
*/
@RequestMapping(value = "/pea-user/getSettings", method = RequestMethod.GET)
Result<List<UserMenuSettingInfo>> getSettings(@RequestHeader("userId") String userId);
/**
* 获取用户组织
*
* @return
*/
@RequestMapping(value = "/pea-user/saveSetting", method = RequestMethod.POST)
Result saveSetting(@RequestBody UserMenuSettingInfo menuSettingInfo);
}