-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #227 from Team-Smeme/refactor_#186_unan
[REFACTOR] Swagger Interface로 분리 작업
- Loading branch information
Showing
30 changed files
with
208 additions
and
48 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
smeem-api/src/main/java/com/smeem/api/auth/api/AuthApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package com.smeem.api.auth.api; | ||
|
||
import com.smeem.api.auth.api.dto.request.SignInRequest; | ||
import com.smeem.api.common.BaseResponse; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.Parameter; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponses; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestHeader; | ||
|
||
import java.security.Principal; | ||
|
||
import static io.swagger.v3.oas.annotations.enums.ParameterIn.HEADER; | ||
|
||
@Tag(name = "[Auth] 인증 관련 API (V2)") | ||
public interface AuthApi { | ||
|
||
@Operation(summary = "소셜 로그인 API") | ||
@Parameter(name = "Authorization", description = "Bearer ${Social Platform Access Token}", in = HEADER, required = true) | ||
@ApiResponses(value = { | ||
@ApiResponse(responseCode = "201", description = "소셜로그인 성공"), | ||
@ApiResponse(responseCode = "4xx", description = "유효하지 않은 요청"), | ||
@ApiResponse(responseCode = "401", description = "유효하지 않은 토큰입니다"), | ||
@ApiResponse(responseCode = "500", description = "서버 내부 오류") | ||
}) | ||
ResponseEntity<BaseResponse<?>> signIn(@RequestHeader("Authorization") final String socialAccessToken, @RequestBody SignInRequest request); | ||
|
||
@Operation(summary = "토큰 재발급 API") | ||
@Parameter(name = "Authorization", description = "Bearer ${Smeme Refresh Token}", in = HEADER, required = true) | ||
@ApiResponses(value = { | ||
@ApiResponse(responseCode = "200", description = "토큰 재발급 성공"), | ||
@ApiResponse(responseCode = "401", description = "유효하지 않은 토큰입니다"), | ||
@ApiResponse(responseCode = "500", description = "서버 내부 오류") | ||
}) | ||
ResponseEntity<BaseResponse<?>> reissueToken(Principal principal); | ||
|
||
|
||
@Operation(summary = "사용자 로그아웃 API") | ||
@Parameter(name = "Authorization", description = "Bearer ${Smeme Access Token}", in = HEADER, required = true) | ||
@ApiResponses(value = { | ||
@ApiResponse(responseCode = "200", description = "로그아웃 성공"), | ||
@ApiResponse(responseCode = "401", description = "유효하지 않은 토큰입니다"), | ||
@ApiResponse(responseCode = "500", description = "서버 내부 오류") | ||
}) | ||
ResponseEntity<BaseResponse<?>> signOut(Principal principal); | ||
|
||
|
||
@Operation(summary = "회원 탈퇴 API") | ||
@Parameter(name = "Authorization", description = "Bearer ${Smeme Access Token}", in = HEADER, required = true) | ||
@ApiResponses(value = { | ||
@ApiResponse(responseCode = "200", description = "회원 탈퇴 성공"), | ||
@ApiResponse(responseCode = "401", description = "유효하지 않은 토큰입니다"), | ||
@ApiResponse(responseCode = "500", description = "서버 내부 오류") | ||
}) | ||
ResponseEntity<BaseResponse<?>> withDrawl(Principal principal); | ||
|
||
} |
8 changes: 4 additions & 4 deletions
8
...m/api/auth/controller/AuthController.java → ...om/smeem/api/auth/api/AuthController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...controller/dto/request/SignInRequest.java → ...i/auth/api/dto/request/SignInRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ntroller/dto/response/SignInResponse.java → ...auth/api/dto/response/SignInResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ler/dto/response/token/TokenResponse.java → ...api/dto/response/token/TokenResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
smeem-api/src/main/java/com/smeem/api/auth/service/dto/request/SignInServiceRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
smeem-api/src/main/java/com/smeem/api/badge/api/BadgeApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.smeem.api.badge.api; | ||
|
||
import com.smeem.api.common.BaseResponse; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.Parameter; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponses; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import org.springframework.http.ResponseEntity; | ||
|
||
import java.security.Principal; | ||
|
||
import static io.swagger.v3.oas.annotations.enums.ParameterIn.HEADER; | ||
|
||
|
||
@Tag(name = "[Badge] 뱃지 관련 API (V2)") | ||
public interface BadgeApi { | ||
|
||
@Operation(summary = "뱃지 목록 조회 API") | ||
@Parameter(name = "Authorization", description = "Bearer ${Smeme Access Token}", in = HEADER, required = true) | ||
@ApiResponses(value = { | ||
@ApiResponse(responseCode = "200", description = "뱃지 리스트 조회 성공"), | ||
@ApiResponse(responseCode = "4011", description = "유효하지 않은 토큰입니다"), | ||
@ApiResponse(responseCode = "500", description = "서버 내부 오류") | ||
}) | ||
ResponseEntity<BaseResponse<?>> getBadges(Principal principal); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...r/dto/response/AcquiredBadgeResponse.java → ...i/dto/response/AcquiredBadgeResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...oller/dto/response/BadgeBaseResponse.java → ...e/api/dto/response/BadgeBaseResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...oller/dto/response/BadgeListResponse.java → ...e/api/dto/response/BadgeListResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ontroller/dto/response/BadgeResponse.java → ...badge/api/dto/response/BadgeResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 1 addition & 4 deletions
5
...oller/dto/response/BadgeTypeResponse.java → ...e/api/dto/response/BadgeTypeResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
smeem-api/src/main/java/com/smeem/api/diary/api/dto/response/DiaryCreateResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
smeem-api/src/main/java/com/smeem/api/member/api/MemberApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package com.smeem.api.member.api; | ||
|
||
import com.smeem.api.common.BaseResponse; | ||
import com.smeem.api.member.api.dto.request.MemberPlanUpdateRequest; | ||
import com.smeem.api.member.api.dto.request.MemberPushUpdateRequest; | ||
import com.smeem.api.member.api.dto.request.MemberUpdateRequest; | ||
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.responses.ApiResponse; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponses; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import jakarta.validation.Valid; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
|
||
import java.security.Principal; | ||
|
||
import static io.swagger.v3.oas.annotations.enums.ParameterIn.HEADER; | ||
|
||
@Tag(name = "[Member] 사용자 관련 API (V2)") | ||
public interface MemberApi { | ||
@Operation(summary = "사용자 프로필 업데이트 API") | ||
@Parameter(name = "Authorization", description = "Bearer ${Smeme Access Token}", in = HEADER, required = true) | ||
@ApiResponses(value = { | ||
@ApiResponse(responseCode = "200", description = "회원 정보 조회 성공"), | ||
@ApiResponse(responseCode = "401", description = "유효하지 않은 토큰입니다"), | ||
@ApiResponse(responseCode = "4xx", description = "유효하지 않은 요청"), | ||
@ApiResponse(responseCode = "500", description = "서버 오류") | ||
}) | ||
ResponseEntity<BaseResponse<?>> updateProfile(Principal principal, @RequestBody MemberUpdateRequest request); | ||
|
||
|
||
@Operation(summary = "사용자 프로필 조회 API") | ||
@Parameter(name = "Authorization", description = "Bearer ${Smeme Access Token}", in = HEADER, required = true) | ||
@ApiResponses(value = { | ||
@ApiResponse(responseCode = "200", description = "회원 정보 조회 성공"), | ||
@ApiResponse(responseCode = "401", description = "유효하지 않은 토큰입니다"), | ||
@ApiResponse(responseCode = "500", description = "서버 내부 오류") | ||
}) | ||
ResponseEntity<BaseResponse<?>> getProfile(Principal principal); | ||
|
||
@Operation(summary = "사용자 학습 계획 수정 API") | ||
@Parameter(name = "Authorization", description = "Bearer ${Smeme Access Token}", in = HEADER, required = true) | ||
@ApiResponses(value = { | ||
@ApiResponse(responseCode = "200", description = "회원 학습 계획 업데이트 성공"), | ||
@ApiResponse(responseCode = "4xx", description = "유효하지 않은 요청"), | ||
@ApiResponse(responseCode = "401", description = "유효하지 않은 토큰입니다"), | ||
@ApiResponse(responseCode = "500", description = "서버 내부 오류") | ||
}) | ||
ResponseEntity<BaseResponse<?>> updateUserPlan(Principal principal, @Valid @RequestBody MemberPlanUpdateRequest request); | ||
|
||
@Operation(summary = "사용자 닉네임 중복체크 수정 API") | ||
@Parameter(name = "Authorization", description = "Bearer ${Smeme Access Token}", in = HEADER, required = true) | ||
@ApiResponses(value = { | ||
@ApiResponse(responseCode = "200", description = "닉네임 중복 검사 성공"), | ||
@ApiResponse(responseCode = "401", description = "유효하지 않은 토큰입니다"), | ||
@ApiResponse(responseCode = "500", description = "서버 내부 오류") | ||
}) | ||
ResponseEntity<BaseResponse<?>> checkDuplicatedName(@Parameter(description = "유저 닉네임") @RequestParam String name); | ||
|
||
@Operation(summary = "사용자 학습 계획 수정 API") | ||
@Parameter(name = "Authorization", description = "Bearer ${Smeme Access Token}", in = HEADER, required = true) | ||
@ApiResponses(value = { | ||
@ApiResponse(responseCode = "200", description = "회원 푸시알람 동의여부 업데이트 성공"), | ||
@ApiResponse(responseCode = "401", description = "유효하지 않은 토큰입니다"), | ||
@ApiResponse(responseCode = "500", description = "서버 내부 오류") | ||
}) | ||
ResponseEntity<BaseResponse<?>> updateUserPush(Principal principal, @RequestBody MemberPushUpdateRequest request); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ber/controller/dto/UsernameValidator.java → ...api/member/api/dto/UsernameValidator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../member/controller/dto/ValidUsername.java → ...eem/api/member/api/dto/ValidUsername.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../dto/request/MemberPlanUpdateRequest.java → .../dto/request/MemberPlanUpdateRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../dto/request/MemberPushUpdateRequest.java → .../dto/request/MemberPushUpdateRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ller/dto/request/MemberUpdateRequest.java → .../api/dto/request/MemberUpdateRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ller/dto/request/TrainingTimeRequest.java → .../api/dto/request/TrainingTimeRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...oller/dto/response/MemberGetResponse.java → ...r/api/dto/response/MemberGetResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...ller/dto/response/MemberNameResponse.java → .../api/dto/response/MemberNameResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.