Commit 4db9b507 authored by suntao's avatar suntao

添加删除用户功能

parent 7687f7aa
......@@ -89,6 +89,18 @@ public class UserController {
return this.userService.disableUser(id);
}
/**
* s删除用户
*
* @param id 用户ID
* @return
*/
@DeleteMapping("/delete")
@Security(authorityId = "User.delete")
public Boolean deleteUser(@RequestParam @Valid @NotNull(message = "无效的用户ID") Long id) {
return this.userService.deleteUser(id);
}
/**
* 移除用户
*
......
......@@ -53,6 +53,10 @@ public interface UserService {
Result<Boolean> updatePassword(UpdatePasswordParam updatePasswordParam);
/**
* 删除用户
* @param id
* @return
*/
Boolean deleteUser(Long id);
}
......@@ -372,4 +372,10 @@ public class UserServiceImpl implements UserService {
userRepository.save(user);
return Result.buildSuccess(true);
}
@Override
public Boolean deleteUser(Long id) {
userRepository.delete(id);
return true;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment