| | |
| | | import com.dg.core.HttpStatus; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.annotation.CurrentUser; |
| | | import com.dg.core.db.gen.entity.HuaChengSysUser; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.manager.TokenManager; |
| | |
| | | @ApiOperation("新增用户接口") |
| | | @PostMapping("/add") |
| | | @Authorization |
| | | public ResultData insertConfig(@RequestBody SysUser config) |
| | | public ResultData insertConfig(@RequestBody SysUser config, @CurrentUser SysUser sysUser) |
| | | { |
| | | Assert.notNull(config, "parameter can not be empty"); |
| | | |
| | |
| | | return error("该账户已存在!"); |
| | | } |
| | | |
| | | |
| | | config.setCreateBy(sysUser.getUserId()+""); |
| | | config.setUserId(Snowflake.getId()); |
| | | config.setUserType("3"); |
| | | |
| | |
| | | @ApiOperation("修改用户接口") |
| | | @PostMapping("/update") |
| | | @Authorization |
| | | public ResultData updateConfig(@RequestBody SysUser config) |
| | | public ResultData updateConfig(@RequestBody SysUser config,@CurrentUser SysUser sys) |
| | | { |
| | | if(config.getUserId()==null) |
| | | if(config.getId()==null) |
| | | { |
| | | return error("userId不能为空"); |
| | | return error("Id不能为空"); |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(config.getLoginName())) |
| | |
| | | } |
| | | |
| | | config.setUserType("3"); |
| | | |
| | | config.setUpdateBy(sys.getUserId()+""); |
| | | |
| | | return toAjax(IUserService.updateConfig(config)); |
| | | } |
| | |
| | | return error("输入密码与原密码不能相同!"); |
| | | } |
| | | |
| | | |
| | | |
| | | return toAjax(IUserService.updateConfig(config)); |
| | | } |
| | | |