Skip to content

Commit

Permalink
feat: 회원탈퇴 api v2를 추가한다.
Browse files Browse the repository at this point in the history
  • Loading branch information
rlarltj committed May 9, 2024
1 parent 271b9fb commit 1d4e6cb
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: gradle build

on:
pull_request:
branches: [ main ]
branches:
- main
- dev

# 권한 설정
permissions: write-all
Expand Down
29 changes: 29 additions & 0 deletions src/main/java/com/moneymong/domain/user/api/UserControllerV2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.moneymong.domain.user.api;

import com.moneymong.domain.user.api.request.UserDeleteRequest;
import com.moneymong.domain.user.service.UserFacadeService;
import com.moneymong.global.security.token.dto.jwt.JwtAuthentication;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.*;

@Tag(name = "1. [유저 V2]")
@RequestMapping("/api/v2/users")
@RequiredArgsConstructor
@RestController
public class UserControllerV2 {

private final UserFacadeService userFacadeService;

@Operation(summary = "회원 탈퇴")
@DeleteMapping("/me")
public void deleteUser(
@AuthenticationPrincipal JwtAuthentication user,
@Valid UserDeleteRequest deleteRequest
) {
userFacadeService.revoke(deleteRequest, user.getId());
}
}

0 comments on commit 1d4e6cb

Please sign in to comment.