forked from kidgrow-microservices-platform

zhaoxiaohao
2020-11-03 1a39d6ffecc6b4949f06dd03a8f64df0de75851a
kidgrow-business/kidgrow-usercenter/kidgrow-usercenter-server/src/main/java/com/kidgrow/usercenter/controller/SysUserController.java
@@ -26,7 +26,6 @@
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;
@@ -87,7 +86,7 @@
     */
    @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);
    }
@@ -256,7 +255,7 @@
     * 返回给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("请输入密码");
        }
@@ -328,7 +327,20 @@
        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更新