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