Skip to content

Commit

Permalink
refactor: Spring에서 제공하는 APPLICATION_JSON_VALUE 사용
Browse files Browse the repository at this point in the history
  • Loading branch information
Kimprodp committed Aug 8, 2024
1 parent c52f4a1 commit 3da393e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
20 changes: 10 additions & 10 deletions backend/src/main/java/reviewme/review/controller/ReviewApi.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package reviewme.review.controller;

import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.headers.Header;
Expand All @@ -22,23 +24,21 @@
@Tag(name = "리뷰 관리")
public interface ReviewApi {

String APPLICATION_JSON = "application/json";

@Operation(summary = "리뷰 등록", description = "리뷰 작성 정보를 받아 리뷰를 등록한다.")
@ApiResponses(value = {
@ApiResponse(
responseCode = "201",
description = "응답 성공 : 리뷰 등록 완료",
headers = {
@Header(name = "Content-Type", description = APPLICATION_JSON),
@Header(name = "Content-Type", description = APPLICATION_JSON_VALUE),
@Header(name = "Location", description = "/reviews/{reviewId}")
}
),
@ApiResponse(
responseCode = "400",
description = "응답 실패 : 올바르지 않은 리뷰 요청 코드",
content = @Content(
mediaType = APPLICATION_JSON,
mediaType = APPLICATION_JSON_VALUE,
examples = @ExampleObject(value = """
{
"type": "about:blank",
Expand All @@ -60,15 +60,15 @@ public interface ReviewApi {
responseCode = "200",
description = "응답 성공 : 리뷰 작성을 위한 정보 응답",
content = @Content(
mediaType = APPLICATION_JSON,
mediaType = APPLICATION_JSON_VALUE,
schema = @Schema(implementation = ReviewSetupResponse.class)
)
),
@ApiResponse(
responseCode = "400",
description = "응답 실패 : 올바르지 않은 리뷰 요청 코드",
content = @Content(
mediaType = APPLICATION_JSON,
mediaType = APPLICATION_JSON_VALUE,
examples = @ExampleObject(value = """
{
"type": "about:blank",
Expand All @@ -94,15 +94,15 @@ ResponseEntity<ReviewSetupResponse> findReviewCreationSetup(
responseCode = "200",
description = "응답 성공 : 리뷰 목록 응답",
content = @Content(
mediaType = APPLICATION_JSON,
mediaType = APPLICATION_JSON_VALUE,
schema = @Schema(implementation = ReceivedReviewsResponse.class)
)
),
@ApiResponse(
responseCode = "400",
description = "응답 실패 : 올바르지 않은 그룹 액세스 코드",
content = @Content(
mediaType = APPLICATION_JSON,
mediaType = APPLICATION_JSON_VALUE,
examples = @ExampleObject(value = """
{
"type": "about:blank",
Expand All @@ -129,15 +129,15 @@ ResponseEntity<ReceivedReviewsResponse> findReceivedReviews(
responseCode = "200",
description = "응답 성공 : 리뷰 정보 응답",
content = @Content(
mediaType = APPLICATION_JSON,
mediaType = APPLICATION_JSON_VALUE,
schema = @Schema(implementation = ReviewDetailResponse.class)
)
),
@ApiResponse(
responseCode = "400",
description = "응답 실패 : 올바르지 않은 그룹 액세스 코드",
content = @Content(
mediaType = APPLICATION_JSON,
mediaType = APPLICATION_JSON_VALUE,
examples = @ExampleObject(value = """
{
"type": "about:blank",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package reviewme.reviewgroup.controller;

import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
Expand All @@ -23,7 +25,7 @@ public interface ReviewGroupApi {
responseCode = "200",
description = "응답 성공 : 리뷰 그룹 생성",
content = @Content(
mediaType = APPLICATION_JSON,
mediaType = APPLICATION_JSON_VALUE,
schema = @Schema(implementation = ReviewGroupCreationRequest.class)
)
)
Expand Down

0 comments on commit 3da393e

Please sign in to comment.