| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.cache.annotation.CacheEvict; |
| | | import org.springframework.cache.annotation.CachePut; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | |
| | | */ |
| | | @GetMapping(value = "/users/name/{username}") |
| | | @ApiOperation(value = "根据用户名查询用户实体") |
| | | @Cacheable(value = "user", key = "#username") |
| | | // @Cacheable(value = "user", key = "#username") |
| | | public SysUser selectByUsername(@PathVariable String username) { |
| | | return appUserService.selectByUsername(username); |
| | | } |
| | |
| | | * 返回给Python加密密码 |
| | | */ |
| | | @GetMapping(value = "/users/python") |
| | | public ResultBody jiaMipython(@RequestBody String password) { |
| | | public ResultBody jiaMipython(@RequestParam("password") String password) { |
| | | if (password==null||"".equals(password)) { |
| | | return ResultBody.failed().msg("请输入密码"); |
| | | } |
| | |
| | | boolean v = appUserService.delUser(id); |
| | | return ResultBody.ok().msg("删除成功").data(v); |
| | | } |
| | | |
| | | /** |
| | | * 删除用户 不删除关系表 ,role_user 表 和 用户组织 |
| | | * |
| | | * @param id |
| | | */ |
| | | @DeleteMapping(value = "/users/deleteNoContact/{id}") |
| | | //@AuditLog(operation = "'删除用户:' + #id") |
| | | public ResultBody deleteNoContact(@PathVariable Long id) { |
| | | if (checkAdmin(id)) { |
| | | return ResultBody.failed(ADMIN_CHANGE_MSG); |
| | | } |
| | | boolean v = appUserService.deleteNoContact(id); |
| | | return ResultBody.ok().msg("删除成功").data(v); |
| | | } |
| | | |
| | | /** |
| | | * 新增or更新 |