添加接口:强制注册用户
This commit is contained in:
parent
13cf9137af
commit
61bfb895cd
@ -219,6 +219,23 @@ public class SysUserController {
|
|||||||
return sysUserService.addUser(userQo, servletRequest);
|
return sysUserService.addUser(userQo, servletRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册系统用户
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/add2", method = RequestMethod.POST)
|
||||||
|
public String addUser2(@Validated({SysUserQoInsert.class}) @RequestBody SysUserQo userQo, BindingResult bindingResult, HttpServletRequest servletRequest) {
|
||||||
|
// 验证数据合法性
|
||||||
|
if (bindingResult.hasErrors()) {
|
||||||
|
return outputEncapsulationErrorList(bindingResult.getFieldErrors(), locale);
|
||||||
|
}
|
||||||
|
// 验证用户名是否重复
|
||||||
|
if (!sysUserService.checkUserName(userQo.getUserName())) {
|
||||||
|
return outputEncapsulationObject(PromptMessageEnum.PARAM_ILLEGAL, "该账号已经注册,请勿重复注册", locale);
|
||||||
|
}
|
||||||
|
// 添加新用户
|
||||||
|
return sysUserService.addUser(userQo, servletRequest);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除系统用户
|
* 删除系统用户
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user