Skip to content

Commit

Permalink
refactor: swagger tags -> @tag
Browse files Browse the repository at this point in the history
  • Loading branch information
yeonjy committed Jun 30, 2024
1 parent 86c8b0a commit 79686b8
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@
import io.swagger.v3.oas.annotations.enums.ParameterIn;
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.springframework.data.domain.Pageable;

import java.util.List;

@Tag(name = "Bookmark")
public interface BookmarkApi {
@Operation(
summary = "북마크 전체 조회",
description = "회원이 북마크한 뉴스를 페이지로 나누어 조회합니다.",
security = {@SecurityRequirement(name = "access_token")},
tags = {"북마크"}
security = {@SecurityRequirement(name = "access_token")}
)
@ApiResponse(
responseCode = "200",
Expand All @@ -30,8 +31,7 @@ SuccessResponse<List<NewsResponse>> getAllBookmarkedNews(
@Operation(
summary = "뉴스 북마크 여부 조회",
description = "로그인한 회원이 해당 뉴스를 북마크 했는지 여부를 조회합니다.",
security = {@SecurityRequirement(name = "access_token")},
tags = {"북마크"}
security = {@SecurityRequirement(name = "access_token")}
)
@ApiResponse(
responseCode = "200",
Expand All @@ -46,8 +46,7 @@ SuccessResponse<BookmarkResponse> getIsBookmarked(
@Operation(
summary = "북마크 저장",
description = "뉴스에 대하여 북마크로 저장합니다.",
security = {@SecurityRequirement(name = "access_token")},
tags = {"북마크"}
security = {@SecurityRequirement(name = "access_token")}
)
@ApiResponse(
responseCode = "201",
Expand All @@ -61,8 +60,7 @@ SuccessResponse<String> saveBookmark(
@Operation(
summary = "북마크 삭제",
description = "저장된 북마크를 해제합니다.",
security = {@SecurityRequirement(name = "access_token")},
tags = {"북마크"}
security = {@SecurityRequirement(name = "access_token")}
)
@ApiResponse(
responseCode = "204",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;


@Tag(name = "Debate")
public interface DebateApi {

@Operation(
summary = "토론방 생성",
description = "주제가 선택된 토론방을 생성합니다.",
security = {@SecurityRequirement(name = "access_token")},
tags = {"토론방"}
security = {@SecurityRequirement(name = "access_token")}
)
@ApiResponse(
responseCode = "201",
Expand All @@ -36,8 +36,7 @@ public interface DebateApi {
@Operation(
summary = "토론방 전체 조회",
description = "회원의 토론방을 페이지로 나누어 조회합니다.",
security = {@SecurityRequirement(name = "access_token")},
tags = {"토론방"}
security = {@SecurityRequirement(name = "access_token")}
)
@ApiResponse(
responseCode = "200",
Expand All @@ -48,8 +47,7 @@ public interface DebateApi {
@Operation(
summary = "토론방 삭제",
description = "토론방을 삭제합니다.",
security = {@SecurityRequirement(name = "access_token")},
tags = {"토론방"}
security = {@SecurityRequirement(name = "access_token")}
)
@ApiResponse(
responseCode = "204",
Expand All @@ -62,8 +60,7 @@ SuccessResponse<String> deleteDebateRoom(@Parameter(in = ParameterIn.PATH, descr
@Operation(
summary = "[인간] 토론 메세지 저장",
description = "사용자가 보낸 토론 메세지를 저장합니다.",
security = {@SecurityRequirement(name = "access_token")},
tags = {"토론 메세지"}
security = {@SecurityRequirement(name = "access_token")}
)
@ApiResponse(
responseCode = "201",
Expand All @@ -79,8 +76,7 @@ SuccessResponse<String> saveHumanDebateMessage(
@Operation(
summary = "[AI] 토론 메세지 저장",
description = "ChatGPT OPENAI가 보낸 토론 메세지를 저장합니다.",
security = {@SecurityRequirement(name = "access_token")},
tags = {"토론 메세지"}
security = {@SecurityRequirement(name = "access_token")}
)
@ApiResponse(
responseCode = "201",
Expand All @@ -96,8 +92,7 @@ SuccessResponse<String> saveAIDebateMessage(
@Operation(
summary = "토론 종료",
description = "토론을 종료합니다.",
security = {@SecurityRequirement(name = "access_token")},
tags = {"토론방"}
security = {@SecurityRequirement(name = "access_token")}
)
@ApiResponses(value = {
@ApiResponse(
Expand All @@ -117,8 +112,7 @@ SuccessResponse<String> finishDebate(
@Operation(
summary = "토론 메세지 조회",
description = "토론방의 토론 메세지 이력을 조회합니다.",
security = {@SecurityRequirement(name = "access_token")},
tags = {"토론 메세지"}
security = {@SecurityRequirement(name = "access_token")}
)
@ApiResponse(
responseCode = "200",
Expand All @@ -132,8 +126,7 @@ SuccessResponse<List<DebateMessageResponse>> getDebateMessages(
@Operation(
summary = "토론 요약",
description = "토론방의 토론 메세지들을 요약합니다.",
security = {@SecurityRequirement(name = "access_token")},
tags = {"토론방"}
security = {@SecurityRequirement(name = "access_token")}
)
@ApiResponses(value = {
@ApiResponse(
Expand All @@ -153,8 +146,7 @@ SuccessResponse<DebateSummaryResponse> summarizeDebate(
@Operation(
summary = "토론 요약 조회",
description = "토론 요약 내용을 조회합니다.",
security = {@SecurityRequirement(name = "access_token")},
tags = {"토론방"}
security = {@SecurityRequirement(name = "access_token")}
)
@ApiResponses(value = {
@ApiResponse(
Expand All @@ -170,5 +162,4 @@ SuccessResponse<DebateSummaryResponse> getSummarizedDebate(
@Parameter(in = ParameterIn.PATH, description = "토론방 ID", required = true)
Long roomId
);

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;

@Tag(name = "Member")
public interface MemberApi {
@Operation(
summary = "회원 정보 조회",
description = "회원 정보를 조회합니다.",
security = {@SecurityRequirement(name = "access_token")},
tags = {"member"}
security = {@SecurityRequirement(name = "access_token")}
)
@ApiResponse(
responseCode = "200",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.data.domain.Pageable;

import java.util.List;

@Tag(name = "Tag")
public interface NewsApi {
@Operation(
summary = "요약 뉴스 전체 조회",
description = "요약 뉴스를 페이지로 나누어 조회합니다.",
security = {@SecurityRequirement(name = "access_token")},
tags = {"news"}
security = {@SecurityRequirement(name = "access_token")}
)
@ApiResponse(
responseCode = "200",
Expand All @@ -30,8 +31,7 @@ public interface NewsApi {
@Operation(
summary = "요약 뉴스 상세 조회",
description = "하나의 요약 뉴스를 상세 조회합니다.",
security = {@SecurityRequirement(name = "access_token")},
tags = {"news"}
security = {@SecurityRequirement(name = "access_token")}
)
@ApiResponses(value = {
@ApiResponse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
import io.swagger.v3.oas.annotations.Operation;
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 java.util.List;

@Tag(name = "Read News")
public interface ReadNewsApi {
@Operation(
summary = "최근 읽은 뉴스 조회",
description = "가장 최근에 읽은 3개의 뉴스를 조회합니다.",
security = {@SecurityRequirement(name = "access_token")},
tags = {"news"}
security = {@SecurityRequirement(name = "access_token")}
)
@ApiResponse(
responseCode = "200",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@
import io.swagger.v3.oas.annotations.Operation;
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 java.util.List;

@Tag(name = "Statistics")
public interface StatisticsApi {
@Operation(
summary = "최근 일주일 날짜별 뉴스 조회수 조회",
description = "최근 일주일간 날짜별로 뉴스 조회수를 조회합니다.",
security = {@SecurityRequirement(name = "access_token")},
tags = {"통계"}
security = {@SecurityRequirement(name = "access_token")}
)
@ApiResponse(
responseCode = "200",
Expand All @@ -25,8 +26,7 @@ public interface StatisticsApi {
@Operation(
summary = "카테고리별 조회수 조회",
description = "카테고리별 조회수를 조회합니다.",
security = {@SecurityRequirement(name = "access_token")},
tags = {"통계"}
security = {@SecurityRequirement(name = "access_token")}
)
@ApiResponse(
responseCode = "200",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@
import io.swagger.v3.oas.annotations.Operation;
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 jakarta.servlet.http.HttpServletResponse;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;

@Tag(name = "Auth")
public interface AuthApi {
@Operation(
summary = "소셜 로그인",
description = "소셜 로그인을 합니다. 회원가입이 되어있지 않은 회원일 경우, 회원가입이 진행됩니다.",
security = {@SecurityRequirement(name = "access_token")},
tags = {"인증"}
security = {@SecurityRequirement(name = "access_token")}
)
@ApiResponse(
responseCode = "200",
Expand All @@ -30,8 +31,7 @@ SuccessResponse<String> login(
@Operation(
summary = "닉네임 입력",
description = "닉네임을 입력합니다. 해당 로직이 진행되어야 회원가입이 완료됩니다.",
security = {@SecurityRequirement(name = "access_token")},
tags = {"인증"}
security = {@SecurityRequirement(name = "access_token")}
)
@ApiResponse(
responseCode = "201",
Expand Down

0 comments on commit 79686b8

Please sign in to comment.