修改
This commit is contained in:
parent
a4a95d66b3
commit
f564b64622
@ -56,12 +56,12 @@ public class UserController {
|
||||
* @return {@link BaseResponse}
|
||||
*/
|
||||
@PutMapping("/user/lock")
|
||||
public BaseResponse userLock(HttpServletRequest request,@RequestParam Long id) {
|
||||
public BaseResponse userLock(HttpServletRequest request,@RequestParam Long id,@RequestParam Long isLock) {
|
||||
// 判断是否有参数错误
|
||||
if (id == null) {
|
||||
return ResultUtil.error(ErrorCode.PARAMETER_ERROR);
|
||||
}
|
||||
return userService.userLock(request,id);
|
||||
return userService.userLock(request,id,isLock);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -69,8 +69,8 @@ public class UserDAO {
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
public void userLock(Long id) {
|
||||
userMapper.userLock(id);
|
||||
public void userLock(Long id,Long isLock) {
|
||||
userMapper.userLock(id,isLock);
|
||||
}
|
||||
|
||||
public void userEditProfile(UserEditProfileVO userEditProfileVO) {
|
||||
|
@ -30,8 +30,8 @@ public interface UserMapper {
|
||||
@Update("UPDATE organize_oa.oa_user SET enabled = 0 ,updated_at = CURRENT_TIMESTAMP WHERE id = #{id} ")
|
||||
void userDelete(Long id);
|
||||
|
||||
@Update("UPDATE organize_oa.oa_user SET account_no_locked = 0 ,updated_at = CURRENT_TIMESTAMP WHERE id = #{id} ")
|
||||
void userLock(Long id);
|
||||
@Update("UPDATE organize_oa.oa_user SET account_no_locked = #{isLock} ,updated_at = CURRENT_TIMESTAMP WHERE id = #{id} ")
|
||||
void userLock(Long id,Long isLock);
|
||||
|
||||
@Select("SELECT * FROM organize_oa.oa_user WHERE id = #{id}")
|
||||
UserDO getUserById(Long id);
|
||||
|
@ -46,7 +46,7 @@ public interface UserService {
|
||||
* @param id 用户id
|
||||
* @return {@link BaseResponse}
|
||||
*/
|
||||
BaseResponse userLock(HttpServletRequest request,Long id);
|
||||
BaseResponse userLock(HttpServletRequest request,Long id,Long isLock);
|
||||
|
||||
/**
|
||||
* <h2>用户编辑自己的信息</h2>
|
||||
|
@ -44,14 +44,14 @@ public class UserServiceImpl implements UserService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse userLock(HttpServletRequest request, Long id) {
|
||||
public BaseResponse userLock(HttpServletRequest request, Long id,Long isLock) {
|
||||
if (!Processing.checkUserIsAdmin(request, roleMapper)) {
|
||||
return ResultUtil.error(ErrorCode.NOT_ADMIN);
|
||||
}
|
||||
//判断用户是否存在
|
||||
if (userDAO.isExistUser(id)) {
|
||||
userDAO.userLock(id);
|
||||
return ResultUtil.success("锁定成功");
|
||||
userDAO.userLock(id,isLock);
|
||||
return ResultUtil.success("更改成功");
|
||||
} else return ResultUtil.error(ErrorCode.USER_NOT_EXIST);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user