|
@@ -4,10 +4,10 @@ import com.alibaba.fastjson.JSON;
|
4
|
4
|
import com.xhkjedu.suser.model.system.TUser;
|
5
|
5
|
import com.xhkjedu.suser.service.system.UserService;
|
6
|
6
|
import com.xhkjedu.suser.utils.UserUtil;
|
7
|
|
-import com.xhkjedu.utils.N_Utils;
|
8
|
|
-import com.xhkjedu.vo.ResultVo;
|
9
|
7
|
import com.xhkjedu.suser.vo.assess.AssessParams;
|
10
|
8
|
import com.xhkjedu.suser.vo.system.TeacherVo;
|
|
9
|
+import com.xhkjedu.utils.N_Utils;
|
|
10
|
+import com.xhkjedu.vo.ResultVo;
|
11
|
11
|
import org.springframework.beans.factory.annotation.Autowired;
|
12
|
12
|
import org.springframework.beans.factory.annotation.Value;
|
13
|
13
|
import org.springframework.util.LinkedMultiValueMap;
|
|
@@ -37,159 +37,170 @@ public class UserController {
|
37
|
37
|
private String ssourl;
|
38
|
38
|
|
39
|
39
|
/**
|
40
|
|
- *功能描述 登录接口--非学生
|
|
40
|
+ * 功能描述 登录接口--非学生
|
|
41
|
+ *
|
|
42
|
+ * @param * @param user
|
|
43
|
+ * @return com.xhkjedu.vo.ResultVo
|
41
|
44
|
* @author WN
|
42
|
45
|
* @date 2020/6/1
|
43
|
|
- * @param * @param user
|
44
|
|
- * @return com.xhkjedu.vo.ResultVo
|
45
|
46
|
*/
|
46
|
47
|
@PostMapping("/login")
|
47
|
|
- public ResultVo login(@RequestBody TUser user,HttpServletRequest request){
|
|
48
|
+ public ResultVo login(@RequestBody TUser user, HttpServletRequest request) {
|
48
|
49
|
// if (N_Utils.isEmpty(user.getUltype())) return new ResultVo(1,"请更新新版本");
|
49
|
|
- N_Utils.validation(new Object[]{user.getLoginname(),"登录名",2,user.getLoginpwd(),"登录密码",2});
|
|
50
|
+ N_Utils.validation(new Object[]{user.getLoginname(), "登录名", 2, user.getLoginpwd(), "登录密码", 2});
|
50
|
51
|
if (user.getLoginname().length() > 18) return new ResultVo(1, "账号长度超过18个字符");
|
51
|
52
|
Integer usertype = user.getUsertype();
|
52
|
53
|
if (usertype != null && usertype == 2) {//学生登录
|
53
|
54
|
return userService.loginStudent(user, request);
|
54
|
55
|
} else {//教师、管理员登录
|
55
|
|
- return userService.getUserByLoginnameAndPwd(user,request);
|
|
56
|
+ return userService.getUserByLoginnameAndPwd(user, request);
|
56
|
57
|
}
|
57
|
58
|
}
|
58
|
59
|
|
59
|
60
|
//教师登录
|
60
|
61
|
@PostMapping("/login_teacher")
|
61
|
|
- public ResultVo loginTeacher(@RequestBody TUser user,HttpServletRequest request){
|
|
62
|
+ public ResultVo loginTeacher(@RequestBody TUser user, HttpServletRequest request) {
|
62
|
63
|
// if (N_Utils.isEmpty(user.getUltype())) return new ResultVo(1,"请更新新版本");
|
63
|
|
- N_Utils.validation(new Object[]{user.getLoginname(),"登录名",2,user.getLoginpwd(),"登录密码",2});
|
|
64
|
+ N_Utils.validation(new Object[]{user.getLoginname(), "登录名", 2, user.getLoginpwd(), "登录密码", 2});
|
64
|
65
|
if (user.getLoginname().length() > 18) return new ResultVo(1, "账号长度超过18个字符");
|
65
|
|
- return userService.loginTeacher(user,request);
|
|
66
|
+ return userService.loginTeacher(user, request);
|
66
|
67
|
}
|
67
|
68
|
|
68
|
69
|
/**
|
69
|
|
- *功能描述 登录--学生登录
|
|
70
|
+ * 功能描述 登录--学生登录
|
|
71
|
+ *
|
|
72
|
+ * @param * @param user
|
|
73
|
+ * @return com.xhkjedu.vo.ResultVo
|
70
|
74
|
* @author WN
|
71
|
75
|
* @date 2020/6/1
|
72
|
|
- * @param * @param user
|
73
|
|
- * @return com.xhkjedu.vo.ResultVo
|
74
|
76
|
*/
|
75
|
77
|
@PostMapping("/loginstu")
|
76
|
|
- public ResultVo loginStudent(@RequestBody TUser user,HttpServletRequest request){
|
77
|
|
- N_Utils.validation(new Object[]{user.getLoginname(),"登录名",2,user.getLoginpwd(),"登录密码",2});
|
|
78
|
+ public ResultVo loginStudent(@RequestBody TUser user, HttpServletRequest request) {
|
|
79
|
+ N_Utils.validation(new Object[]{user.getLoginname(), "登录名", 2, user.getLoginpwd(), "登录密码", 2});
|
78
|
80
|
if (user.getLoginname().length() > 18) return new ResultVo(1, "账号长度超过18个字符");
|
79
|
|
- return userService.loginStudent(user,request);
|
|
81
|
+ return userService.loginStudent(user, request);
|
80
|
82
|
}
|
81
|
83
|
|
82
|
84
|
/**
|
83
|
85
|
* 添加用户信息
|
|
86
|
+ *
|
|
87
|
+ * @return com.xhkjedu.vo.ResultVo
|
84
|
88
|
* @Param [user]
|
85
|
89
|
* @Author ywx
|
86
|
90
|
* @Date 2020/6/2 9:44
|
87
|
|
- * @return com.xhkjedu.vo.ResultVo
|
88
|
91
|
**/
|
89
|
92
|
@PostMapping("/add")
|
90
|
|
- public ResultVo add(@RequestBody TUser user){
|
|
93
|
+ public ResultVo add(@RequestBody TUser user) {
|
91
|
94
|
return userService.save(user);
|
92
|
95
|
}
|
93
|
96
|
|
94
|
97
|
/**
|
95
|
98
|
* 修改用户信息
|
|
99
|
+ *
|
|
100
|
+ * @return com.xhkjedu.vo.ResultVo
|
96
|
101
|
* @Param [user]
|
97
|
102
|
* @Author ywx
|
98
|
103
|
* @Date 2020/6/2 9:51
|
99
|
|
- * @return com.xhkjedu.vo.ResultVo
|
100
|
104
|
**/
|
101
|
105
|
@PostMapping("/update")
|
102
|
|
- public ResultVo update(@RequestBody TUser user){
|
103
|
|
- N_Utils.validation(new Object[]{user.getUserid(),"用户id",1});
|
|
106
|
+ public ResultVo update(@RequestBody TUser user) {
|
|
107
|
+ N_Utils.validation(new Object[]{user.getUserid(), "用户id", 1});
|
104
|
108
|
return userService.update(user);
|
105
|
109
|
}
|
106
|
110
|
|
107
|
111
|
/**
|
108
|
112
|
* 删除用户
|
|
113
|
+ *
|
|
114
|
+ * @return com.xhkjedu.vo.ResultVo
|
109
|
115
|
* @Param [user]
|
110
|
116
|
* @Author ywx
|
111
|
117
|
* @Date 2020/6/2 9:59
|
112
|
|
- * @return com.xhkjedu.vo.ResultVo
|
113
|
118
|
**/
|
114
|
119
|
@PostMapping("/delete")
|
115
|
|
- public ResultVo delete(@RequestBody TUser user){
|
116
|
|
- N_Utils.validation(new Object[]{user.getUserid(),"用户id",1,user.getDeleteid(),"删除人id",1});
|
|
120
|
+ public ResultVo delete(@RequestBody TUser user) {
|
|
121
|
+ N_Utils.validation(new Object[]{user.getUserid(), "用户id", 1, user.getDeleteid(), "删除人id", 1});
|
117
|
122
|
return userService.deleteById(user);
|
118
|
123
|
}
|
119
|
124
|
|
120
|
125
|
/**
|
121
|
126
|
* 获取用户列表
|
|
127
|
+ *
|
|
128
|
+ * @return com.xhkjedu.vo.ResultVo
|
122
|
129
|
* @Param [user]
|
123
|
130
|
* @Author ywx
|
124
|
131
|
* @Date 2020/6/2 10:06
|
125
|
|
- * @return com.xhkjedu.vo.ResultVo
|
126
|
132
|
**/
|
127
|
133
|
@PostMapping("/list")
|
128
|
|
- public ResultVo list(@RequestBody TUser user){
|
129
|
|
- N_Utils.validation(new Object[]{user.getPage(),"显示页码",1,user.getPageSize(),"显示条数",1,user.getSchoolid(),"学校id",1});
|
|
134
|
+ public ResultVo list(@RequestBody TUser user) {
|
|
135
|
+ N_Utils.validation(new Object[]{user.getPage(), "显示页码", 1, user.getPageSize(), "显示条数", 1, user.getSchoolid(), "学校id", 1});
|
130
|
136
|
return userService.findAll(user);
|
131
|
137
|
}
|
132
|
138
|
|
133
|
139
|
/**
|
134
|
140
|
* 获取用户详情
|
|
141
|
+ *
|
|
142
|
+ * @return com.xhkjedu.vo.ResultVo
|
135
|
143
|
* @Param [user]
|
136
|
144
|
* @Author ywx
|
137
|
145
|
* @Date 2020/6/2 10:23
|
138
|
|
- * @return com.xhkjedu.vo.ResultVo
|
139
|
146
|
**/
|
140
|
147
|
@PostMapping("/detail")
|
141
|
|
- public ResultVo detail(@RequestBody TUser user){
|
|
148
|
+ public ResultVo detail(@RequestBody TUser user) {
|
142
|
149
|
Integer userid = user.getUserid();
|
143
|
|
- N_Utils.validation(new Object[]{userid,"用户id",1});
|
|
150
|
+ N_Utils.validation(new Object[]{userid, "用户id", 1});
|
144
|
151
|
return userService.findById(userid);
|
145
|
152
|
}
|
146
|
153
|
|
147
|
154
|
/**
|
148
|
155
|
* 修改用户密码
|
|
156
|
+ *
|
|
157
|
+ * @return com.xhkjedu.vo.ResultVo
|
149
|
158
|
* @Param [user]
|
150
|
159
|
* @Author ywx
|
151
|
160
|
* @Date 2020/6/2 10:30
|
152
|
|
- * @return com.xhkjedu.vo.ResultVo
|
153
|
161
|
**/
|
154
|
162
|
@PostMapping("/update_pwd")
|
155
|
|
- public ResultVo updatePwd(@RequestBody TUser user){
|
156
|
|
- N_Utils.validation(new Object[]{user.getUserid(),"用户id",1,user.getOldpwd(),"原密码",2,user.getLoginpwd(),"新密码",2});
|
|
163
|
+ public ResultVo updatePwd(@RequestBody TUser user) {
|
|
164
|
+ N_Utils.validation(new Object[]{user.getUserid(), "用户id", 1, user.getOldpwd(), "原密码", 2, user.getLoginpwd(), "新密码", 2});
|
157
|
165
|
return userService.updatePwd(user);
|
158
|
166
|
}
|
159
|
167
|
|
160
|
168
|
/**
|
161
|
169
|
* 修改用户头像
|
|
170
|
+ *
|
|
171
|
+ * @return com.xhkjedu.vo.ResultVo
|
162
|
172
|
* @Param [user]
|
163
|
173
|
* @Author ywx
|
164
|
174
|
* @Date 2020/6/2 10:37
|
165
|
|
- * @return com.xhkjedu.vo.ResultVo
|
166
|
175
|
**/
|
167
|
176
|
@PostMapping("/update_headpic")
|
168
|
|
- public ResultVo updateHeadPic(@RequestBody TUser user){
|
169
|
|
- N_Utils.validation(new Object[]{user.getUserid(),"用户id",1});
|
|
177
|
+ public ResultVo updateHeadPic(@RequestBody TUser user) {
|
|
178
|
+ N_Utils.validation(new Object[]{user.getUserid(), "用户id", 1});
|
170
|
179
|
return userService.updateHeadPic(user);
|
171
|
180
|
}
|
172
|
181
|
|
173
|
182
|
/**
|
174
|
183
|
* 检查登录账号是否存在
|
|
184
|
+ *
|
|
185
|
+ * @return com.xhkjedu.vo.ResultVo
|
175
|
186
|
* @Param [user]
|
176
|
187
|
* @Author ywx
|
177
|
188
|
* @Date 2020/6/2 10:43
|
178
|
|
- * @return com.xhkjedu.vo.ResultVo
|
179
|
189
|
**/
|
180
|
190
|
@PostMapping("/check_loginname")
|
181
|
|
- public ResultVo checkLoginName(@RequestBody TUser user){
|
|
191
|
+ public ResultVo checkLoginName(@RequestBody TUser user) {
|
182
|
192
|
String loginname = user.getLoginname();
|
183
|
|
- N_Utils.validation(new Object[]{loginname,"登录名",2});
|
|
193
|
+ N_Utils.validation(new Object[]{loginname, "登录名", 2});
|
184
|
194
|
return userService.checkLoginName(loginname);
|
185
|
195
|
}
|
186
|
196
|
|
187
|
197
|
/**
|
188
|
198
|
* 导入教师
|
|
199
|
+ *
|
|
200
|
+ * @return com.xhkjedu.vo.ResultVo
|
189
|
201
|
* @Param [file, user]
|
190
|
202
|
* @Author ywx
|
191
|
203
|
* @Date 2020/6/5 8:42
|
192
|
|
- * @return com.xhkjedu.vo.ResultVo
|
193
|
204
|
**/
|
194
|
205
|
@PostMapping("/import_teacher")
|
195
|
206
|
public ResultVo importTeacher(MultipartFile file, TUser user) {
|
|
@@ -197,152 +208,161 @@ public class UserController {
|
197
|
208
|
}
|
198
|
209
|
|
199
|
210
|
/**
|
200
|
|
- *功能描述 设置操作密码
|
|
211
|
+ * 功能描述 设置操作密码
|
|
212
|
+ *
|
|
213
|
+ * @param * @param user
|
|
214
|
+ * @return com.xhkjedu.vo.ResultVo
|
201
|
215
|
* @author WN
|
202
|
216
|
* @date 2020/6/17
|
203
|
|
- * @param * @param user
|
204
|
|
- * @return com.xhkjedu.vo.ResultVo
|
205
|
217
|
*/
|
206
|
218
|
@PostMapping("/update_opepass")
|
207
|
|
- public ResultVo updateOpepass(@RequestBody TUser user){
|
|
219
|
+ public ResultVo updateOpepass(@RequestBody TUser user) {
|
208
|
220
|
N_Utils.validation(new Object[]{
|
209
|
|
- user.getUserid(),"用户id",1,
|
210
|
|
- user.getOpepassword(),"操作密码",2
|
|
221
|
+ user.getUserid(), "用户id", 1,
|
|
222
|
+ user.getOpepassword(), "操作密码", 2
|
211
|
223
|
});
|
212
|
224
|
userService.updateOpepasswordByUserId(user);
|
213
|
|
- return new ResultVo(0,"设置操作密码成功");
|
|
225
|
+ return new ResultVo(0, "设置操作密码成功");
|
214
|
226
|
}
|
215
|
227
|
|
216
|
228
|
/**
|
217
|
|
- *功能描述 验证操作密码是否正确
|
|
229
|
+ * 功能描述 验证操作密码是否正确
|
|
230
|
+ *
|
|
231
|
+ * @param * @param user
|
|
232
|
+ * @return com.xhkjedu.vo.ResultVo
|
218
|
233
|
* @author WN
|
219
|
234
|
* @date 2020/6/17
|
220
|
|
- * @param * @param user
|
221
|
|
- * @return com.xhkjedu.vo.ResultVo
|
222
|
235
|
*/
|
223
|
236
|
@PostMapping("/validate_opepass")
|
224
|
|
- public ResultVo validateOpepass(@RequestBody TUser user){
|
|
237
|
+ public ResultVo validateOpepass(@RequestBody TUser user) {
|
225
|
238
|
N_Utils.validation(new Object[]{
|
226
|
|
- user.getUserid(),"用户id",1,
|
227
|
|
- user.getOpepassword(),"操作密码",2
|
|
239
|
+ user.getUserid(), "用户id", 1,
|
|
240
|
+ user.getOpepassword(), "操作密码", 2
|
228
|
241
|
});
|
229
|
242
|
Integer result = userService.getUserIdByOpepassword(user);
|
230
|
|
- if(result==1){
|
231
|
|
- return new ResultVo(0,"操作密码验证成功");
|
232
|
|
- }else{
|
233
|
|
- return new ResultVo(1,"操作密码输入有误");
|
|
243
|
+ if (result == 1) {
|
|
244
|
+ return new ResultVo(0, "操作密码验证成功");
|
|
245
|
+ } else {
|
|
246
|
+ return new ResultVo(1, "操作密码输入有误");
|
234
|
247
|
}
|
235
|
248
|
|
236
|
249
|
}
|
237
|
250
|
|
238
|
251
|
/**
|
239
|
252
|
* 教师基本信息
|
|
253
|
+ *
|
|
254
|
+ * @return com.xhkjedu.vo.ResultVo
|
240
|
255
|
* @Param [user]
|
241
|
256
|
* @Author ywx
|
242
|
257
|
* @Date 2020/6/29 16:23
|
243
|
|
- * @return com.xhkjedu.vo.ResultVo
|
244
|
258
|
**/
|
245
|
259
|
@PostMapping("/teacher_info")
|
246
|
|
- public ResultVo teacherInfo(@RequestBody TUser user){
|
|
260
|
+ public ResultVo teacherInfo(@RequestBody TUser user) {
|
247
|
261
|
Integer userid = user.getUserid();
|
248
|
|
- N_Utils.validation(new Object[]{userid,"用户id",1});
|
249
|
|
- TeacherVo teacherVo = userService.getTeacherInfo(userid, user.getClasstype());
|
250
|
|
- return new ResultVo(0,"获取教师基本信息成功",teacherVo);
|
|
262
|
+ N_Utils.validation(new Object[]{userid, "用户id", 1, user.getSchoolid(), "学校id", 1});
|
|
263
|
+ TeacherVo teacherVo = userService.getTeacherInfo(user.getSchoolid(), userid, user.getClasstype());
|
|
264
|
+ return new ResultVo(0, "获取教师基本信息成功", teacherVo);
|
251
|
265
|
}
|
252
|
266
|
|
253
|
267
|
/**
|
254
|
268
|
* 重置密码
|
|
269
|
+ *
|
|
270
|
+ * @return com.xhkjedu.vo.ResultVo
|
255
|
271
|
* @Param [user]
|
256
|
272
|
* @Author ywx
|
257
|
273
|
* @Date 2020/7/30 14:25
|
258
|
|
- * @return com.xhkjedu.vo.ResultVo
|
259
|
274
|
**/
|
260
|
275
|
@PostMapping("/reset_pwd")
|
261
|
|
- public ResultVo resetPwd(@RequestBody TUser user){
|
262
|
|
- N_Utils.validation(new Object[]{user.getUserid(),"用户id",1,user.getLoginpwd(),"密码",2});
|
|
276
|
+ public ResultVo resetPwd(@RequestBody TUser user) {
|
|
277
|
+ N_Utils.validation(new Object[]{user.getUserid(), "用户id", 1, user.getLoginpwd(), "密码", 2});
|
263
|
278
|
return userService.resetPwd(user);
|
264
|
279
|
}
|
265
|
280
|
|
266
|
281
|
/**
|
267
|
282
|
* 生成修改码
|
|
283
|
+ *
|
|
284
|
+ * @return com.xhkjedu.vo.ResultVo
|
268
|
285
|
* @Param [user]
|
269
|
286
|
* @Author ywx
|
270
|
287
|
* @Date 2020/10/13 15:08
|
271
|
|
- * @return com.xhkjedu.vo.ResultVo
|
272
|
288
|
**/
|
273
|
289
|
@PostMapping("/update_code")
|
274
|
290
|
public ResultVo updateCode(@RequestBody TUser user) {
|
275
|
291
|
String userphone = user.getUserphone();
|
276
|
|
- N_Utils.validation(new Object[]{userphone,"手机号",2});
|
|
292
|
+ N_Utils.validation(new Object[]{userphone, "手机号", 2});
|
277
|
293
|
return userService.updateCode(userphone);
|
278
|
294
|
}
|
279
|
295
|
|
280
|
296
|
/**
|
281
|
297
|
* 通过短信修改密码
|
|
298
|
+ *
|
|
299
|
+ * @return com.xhkjedu.vo.ResultVo
|
282
|
300
|
* @Param [user]
|
283
|
301
|
* @Author ywx
|
284
|
302
|
* @Date 2020/10/13 15:12
|
285
|
|
- * @return com.xhkjedu.vo.ResultVo
|
286
|
303
|
**/
|
287
|
304
|
@PostMapping("/update_pwd_byCode")
|
288
|
305
|
public ResultVo updatePwdByCode(@RequestBody TUser user) {
|
289
|
306
|
String userphone = user.getUserphone();
|
290
|
307
|
String loginpwd = user.getLoginpwd();
|
291
|
308
|
Integer msgcode = user.getMsgcode();
|
292
|
|
- N_Utils.validation(new Object[]{userphone,"手机号",2,loginpwd,"密码",2,msgcode,"验证码",1});
|
|
309
|
+ N_Utils.validation(new Object[]{userphone, "手机号", 2, loginpwd, "密码", 2, msgcode, "验证码", 1});
|
293
|
310
|
return userService.updatePwdByCode(user);
|
294
|
311
|
}
|
295
|
312
|
|
296
|
313
|
/**
|
297
|
314
|
* 生成登录确认码
|
|
315
|
+ *
|
|
316
|
+ * @return com.xhkjedu.vo.ResultVo
|
298
|
317
|
* @Param [user]
|
299
|
318
|
* @Author ywx
|
300
|
319
|
* @Date 2020/10/13 15:18
|
301
|
|
- * @return com.xhkjedu.vo.ResultVo
|
302
|
320
|
**/
|
303
|
321
|
@PostMapping("/login_code")
|
304
|
322
|
public ResultVo loginCode(@RequestBody TUser user) {
|
305
|
323
|
String userphone = user.getUserphone();
|
306
|
|
- N_Utils.validation(new Object[]{userphone,"手机号",2});
|
|
324
|
+ N_Utils.validation(new Object[]{userphone, "手机号", 2});
|
307
|
325
|
return userService.loginCode(userphone);
|
308
|
326
|
}
|
309
|
327
|
|
310
|
328
|
/**
|
311
|
329
|
* 验证码登录
|
|
330
|
+ *
|
|
331
|
+ * @return com.xhkjedu.vo.ResultVo
|
312
|
332
|
* @Param [user]
|
313
|
333
|
* @Author ywx
|
314
|
334
|
* @Date 2020/10/13 15:35
|
315
|
|
- * @return com.xhkjedu.vo.ResultVo
|
316
|
335
|
**/
|
317
|
336
|
@PostMapping("/login_byCode")
|
318
|
|
- public ResultVo loginByCode(@RequestBody TUser user,HttpServletRequest request) {
|
319
|
|
- if (N_Utils.isEmpty(user.getUltype())) return new ResultVo(1,"请更新新版本");
|
|
337
|
+ public ResultVo loginByCode(@RequestBody TUser user, HttpServletRequest request) {
|
|
338
|
+ if (N_Utils.isEmpty(user.getUltype())) return new ResultVo(1, "请更新新版本");
|
320
|
339
|
String userphone = user.getUserphone();
|
321
|
340
|
Integer msgcode = user.getMsgcode();
|
322
|
|
- N_Utils.validation(new Object[]{userphone,"手机号",2,msgcode,"验证码",1});
|
|
341
|
+ N_Utils.validation(new Object[]{userphone, "手机号", 2, msgcode, "验证码", 1});
|
323
|
342
|
return userService.loginByCode(user, request);
|
324
|
343
|
}
|
325
|
344
|
|
326
|
345
|
/**
|
327
|
346
|
* 批量修改用户密码
|
|
347
|
+ *
|
|
348
|
+ * @return com.xhkjedu.vo.ResultVo
|
328
|
349
|
* @Param [user]
|
329
|
350
|
* @Author ywx
|
330
|
351
|
* @Date 2020/10/30 16:04
|
331
|
|
- * @return com.xhkjedu.vo.ResultVo
|
332
|
352
|
**/
|
333
|
353
|
@PostMapping("/batch_update_pwd")
|
334
|
|
- public ResultVo batchUpdatePwd(@RequestBody TUser user){
|
335
|
|
- N_Utils.validation(new Object[]{user.getSchoolid(),"学校id",1,user.getLoginpwd(),"新密码",2});
|
336
|
|
- if (N_Utils.isListEmpty(user.getUsertypes())) return new ResultVo(1,"用户类型集合不能为空");
|
|
354
|
+ public ResultVo batchUpdatePwd(@RequestBody TUser user) {
|
|
355
|
+ N_Utils.validation(new Object[]{user.getSchoolid(), "学校id", 1, user.getLoginpwd(), "新密码", 2});
|
|
356
|
+ if (N_Utils.isListEmpty(user.getUsertypes())) return new ResultVo(1, "用户类型集合不能为空");
|
337
|
357
|
return userService.batchUpdatePwd(user);
|
338
|
358
|
}
|
339
|
359
|
|
340
|
360
|
//校验登录状态成功
|
341
|
361
|
@PostMapping("/check_login")
|
342
|
|
- public ResultVo checkLogin(@RequestBody TUser user){
|
|
362
|
+ public ResultVo checkLogin(@RequestBody TUser user) {
|
343
|
363
|
Integer userid = user.getUserid();
|
344
|
364
|
String loginpwd = user.getLoginpwd();
|
345
|
|
- N_Utils.validation(new Object[]{userid,"用户id",1,loginpwd,"登录密码",2});
|
|
365
|
+ N_Utils.validation(new Object[]{userid, "用户id", 1, loginpwd, "登录密码", 2});
|
346
|
366
|
return userService.checkLogin(userid, loginpwd);
|
347
|
367
|
}
|
348
|
368
|
|
|
@@ -357,30 +377,31 @@ public class UserController {
|
357
|
377
|
|
358
|
378
|
/**
|
359
|
379
|
* 用户名登录
|
|
380
|
+ *
|
|
381
|
+ * @return com.xhkjedu.vo.ResultVo
|
360
|
382
|
* @Param [user, request]
|
361
|
383
|
* @Author ywx
|
362
|
384
|
* @Date 2021/11/18 9:52
|
363
|
|
- * @return com.xhkjedu.vo.ResultVo
|
364
|
385
|
**/
|
365
|
386
|
@PostMapping("/login_byName")
|
366
|
|
- public ResultVo loginByName(@RequestBody TUser user,HttpServletRequest request) {
|
|
387
|
+ public ResultVo loginByName(@RequestBody TUser user, HttpServletRequest request) {
|
367
|
388
|
String loginname = user.getLoginname();
|
368
|
|
- N_Utils.validation(new Object[]{loginname,"token",2});
|
|
389
|
+ N_Utils.validation(new Object[]{loginname, "token", 2});
|
369
|
390
|
MultiValueMap<String, String> param = new LinkedMultiValueMap<>();
|
370
|
|
- param.add("token",loginname);
|
|
391
|
+ param.add("token", loginname);
|
371
|
392
|
String str = UserUtil.sendFormData(ssourl, param);
|
372
|
393
|
ResultVo result = JSON.parseObject(str, ResultVo.class);
|
373
|
394
|
if (result.getCode() != 0) return result;
|
374
|
|
- Map map = JSON.parseObject(result.getObj().toString(),Map.class);
|
|
395
|
+ Map map = JSON.parseObject(result.getObj().toString(), Map.class);
|
375
|
396
|
user.setLoginname(map.get("loginname").toString());
|
376
|
397
|
return userService.loginByName(user, request);
|
377
|
398
|
}
|
378
|
399
|
|
379
|
400
|
@PostMapping("/get_headtime")
|
380
|
|
- public ResultVo getHeadTime(@RequestBody TUser user){
|
|
401
|
+ public ResultVo getHeadTime(@RequestBody TUser user) {
|
381
|
402
|
Integer userid = user.getUserid();
|
382
|
|
- N_Utils.validation(new Object[]{userid,"用户id",1});
|
|
403
|
+ N_Utils.validation(new Object[]{userid, "用户id", 1});
|
383
|
404
|
Integer headtime = userService.getHeadTime(userid);
|
384
|
|
- return new ResultVo(0,"获取头像是否可以修改成功",headtime);
|
|
405
|
+ return new ResultVo(0, "获取头像是否可以修改成功", headtime);
|
385
|
406
|
}
|
386
|
407
|
}
|