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 명세 예시 추가 - #100 #101

Merged
merged 1 commit into from
Jul 14, 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
88 changes: 88 additions & 0 deletions dateroad-api/src/main/java/org/dateroad/point/api/PointApi.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
package org.dateroad.point.api;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.ExampleObject;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.dateroad.auth.argumentresolve.UserId;
import org.dateroad.point.dto.response.PointGetAllRes;
import org.springframework.http.ResponseEntity;

@Tag(name = "포인트 관련 API")
@SecurityRequirement(name = "Authorization")
public interface PointApi {
@Operation(
summary = "포인트 내역 조회 API",
responses = {
@ApiResponse(
responseCode = "200",
content = @Content(
schema = @Schema(implementation = PointGetAllRes.class),
examples = @ExampleObject(value = """
{
"gained": {
"points": [
{
"point": 100,
"description": "첫 구매 적립",
"createdAt": "2023.07.14"
},
{
"point": 200,
"description": "리뷰 작성 적립",
"createdAt": "2023.07.15"
}
]
},
"used": {
"points": [
{
"point": 50,
"description": "구매 사용",
"createdAt": "2023.07.16"
},
{
"point": 80,
"description": "이벤트 참여 사용",
"createdAt": "2023.07.17"
}
]
}
}
""")
),
description = "요청이 성공했습니다."
),
@ApiResponse(
responseCode = "400",
description = "잘못된 요청입니다.",
content = @Content),
@ApiResponse(
responseCode = "401",
description = "액세스 토큰의 형식이 올바르지 않습니다. Bearer 타입을 확인해 주세요.",
content = @Content),
@ApiResponse(
responseCode = "401",
description = "액세스 토큰의 값이 올바르지 않습니다.",
content = @Content),
@ApiResponse(
responseCode = "401",
description = "액세스 토큰이 만료되었습니다. 재발급 받아주세요.",
content = @Content),
@ApiResponse(
responseCode = "405",
description = "잘못된 HTTP method 요청입니다.",
content = @Content),
@ApiResponse(
responseCode = "500",
description = "서버 내부 오류입니다.",
content = @Content)})
public ResponseEntity<PointGetAllRes> getAllPoints(
@Parameter(required = true)
@UserId Long userId
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@RestController
@RequestMapping("/api/v1/points")
@RequiredArgsConstructor
public class PointController {
public class PointController implements PointApi{
private final PointService pointService;

@GetMapping
Expand Down
Loading