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 문서화 #955

Merged
merged 3 commits into from
Jan 19, 2025
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 @@ -24,4 +24,11 @@ public ResponseEntity<Void> delete(@AuthMember Member member) {
return ResponseEntity.status(HttpStatus.NO_CONTENT)
.build();
}

@Override
@DeleteMapping("/v2/members")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[질문]
v1이 아닌 v2인 이유가 궁금해요🤔

Copy link
Member Author

@mzeong mzeong Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

기존에 존재하는 api를 v1이라고 생각해서 v2라고 지었어요

public ResponseEntity<Void> deleteV2(@AuthMember Member member) {
return ResponseEntity.status(HttpStatus.NO_CONTENT)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.ody.member.domain.Member;
import com.ody.swagger.annotation.ErrorCode401;
import com.ody.swagger.annotation.ErrorCode403;
import com.ody.swagger.annotation.ErrorCode500;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
Expand All @@ -15,10 +16,19 @@
public interface MemberControllerSwagger {

@Operation(
summary = "회원 삭제",
summary = "회원 삭제 (deprecated)",
responses = @ApiResponse(responseCode = "204", description = "회원 삭제 성공")
)
@ErrorCode401
@ErrorCode500
ResponseEntity<Void> delete(@Parameter(hidden = true) Member member);

@Operation(
summary = "회원 삭제",
responses = @ApiResponse(responseCode = "204", description = "회원 삭제 성공")
)
@ErrorCode401
@ErrorCode403
@ErrorCode500
ResponseEntity<Void> deleteV2(@Parameter(hidden = true) Member member);
}
24 changes: 24 additions & 0 deletions backend/src/main/java/com/ody/swagger/annotation/ErrorCode403.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.ody.swagger.annotation;

import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.core.annotation.AliasFor;
import org.springframework.http.ProblemDetail;

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@ApiResponse(
responseCode = "403",
description = "권한 문제로 요청 거절",
content = @Content(schema = @Schema(implementation = ProblemDetail.class))
)
public @interface ErrorCode403 {

@AliasFor(annotation = ApiResponse.class, attribute = "description")
String description() default "권한 문제로 요청 거절";
}
Loading