Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: 회원 탈퇴 api 문서 #73

Merged
merged 3 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ private SocialProfile createMember(String oauthId, String email, SocialType soci

private void deleteMember(long memberId) {
badgeAchievementRepository.deleteByMemberId(memberId);
// todo 챌린지 삭제(챌린지 기능 구현 완료 후)
runningRecordRepository.deleteByMemberId(memberId);
memberLevelRepository.deleteByMemberId(memberId);
socialProfileRepository.deleteByMemberId(memberId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public interface OidcProvider {
String getAccessToken(String code);

/**
*
* 소셜로그인 연결 해제
* @param accessToken 엑세스토큰
*/
void revoke(String accessToken);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@
import com.dnd.runus.presentation.v1.oauth.dto.request.WithdrawRequest;
import com.dnd.runus.presentation.v1.oauth.dto.response.TokenResponse;
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.http.HttpStatus;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "OAuth")
@RequestMapping("/api/v1/auth/oauth")
@RestController
@RequiredArgsConstructor
Expand All @@ -29,11 +33,26 @@ public class OauthController {
@ApiErrorType({ErrorType.UNSUPPORTED_SOCIAL_TYPE, ErrorType.MALFORMED_ACCESS_TOKEN, ErrorType.UNSUPPORTED_JWT_TOKEN
})
@PostMapping
@ResponseStatus(HttpStatus.OK)
public TokenResponse signIn(@Valid @RequestBody OauthRequest request) {
return oauthService.signIn(request);
}

@Operation(
summary = "회원 탈퇴",
description =
"""
## 회원 탈퇴 API입니다.
idToken과 authorizationCode로 애플에서 토큰을 발급합니다.<br>
발급 받은 토큰으로 사용자의 서비스 해제 요청을 합니다.<br>
사용자의 모든 데이터를 삭제합니다.
""")
@ApiErrorType({
ErrorType.UNSUPPORTED_SOCIAL_TYPE,
ErrorType.FAILED_AUTHENTICATION,
})
@PostMapping("/withdraw")
@ResponseStatus(HttpStatus.OK)
public void withdraw(@MemberId long memberId, @Valid @RequestBody WithdrawRequest request) {
oauthService.withdraw(memberId, request);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ public record WithdrawRequest(
@Schema(description = "소셜 로그인 타입")
@NotNull
SocialType socialType,
@Schema(description = "authorizationCode")
@NotBlank
String authorizationCode,
@NotBlank
Expand Down