Skip to content

Commit

Permalink
feat: implement withdraw api
Browse files Browse the repository at this point in the history
  • Loading branch information
Kang1221 committed Aug 23, 2024
1 parent 8acfe17 commit 09806ce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/co/orange/ddanzi/controller/AuthController.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,9 @@ ApiResponse<?> verify(@RequestBody VerifyRequestDto requestDto) {
return authService.verify(requestDto);
}

@DeleteMapping("/withdraw")
ApiResponse<?> withdraw(){
return authService.withdraw();
}

}
7 changes: 7 additions & 0 deletions src/main/java/co/orange/ddanzi/service/auth/AuthService.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ public ApiResponse<?> verify(VerifyRequestDto requestDto){
return ApiResponse.onSuccess(Success.CREATE_AUTHENTICATION_SUCCESS, responseDto);
}

@Transactional
public ApiResponse<?> withdraw(){
User user = authUtils.getUser();
user.updateStatus(UserStatus.DELETE);
return ApiResponse.onSuccess(Success.DELETE_USER_SUCCESS, Map.of("nickname", user.getNickname()));
}

}


0 comments on commit 09806ce

Please sign in to comment.