Skip to content

Commit

Permalink
[fix] : 스웨거 명세 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
dudxo committed Aug 12, 2024
1 parent 4ce42c2 commit af12041
Show file tree
Hide file tree
Showing 15 changed files with 10 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import io.swagger.v3.oas.annotations.Operation;
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 lombok.RequiredArgsConstructor;

Expand All @@ -29,7 +28,7 @@ public class AuthController {
private final AuthService authService;

@Operation(summary = "카카오 로그인 API", description = "카카오 로그인 페이지로 이동 요청한다.(사용불가!!)")
@ApiResponse(responseCode = "301", description = "카카오 로그인 페이지로 이동된다.")
@ApiResponse(useReturnTypeSchema = true)
@GetMapping("/signin/kakao")
public ResponseEntity<?> kakaoLoginRedirect() {
HttpHeaders httpHeaders = new HttpHeaders();
Expand All @@ -38,11 +37,8 @@ public ResponseEntity<?> kakaoLoginRedirect() {
return new ResponseEntity<>(httpHeaders, HttpStatus.MOVED_PERMANENTLY);
}

@Operation(summary = "토큰 발급 API", description = "임시 토큰을 발급한다.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "임시 토큰 발급"),
@ApiResponse(responseCode = "400", description = "중복 소셜 이메일이 존재합니다.")
})
@Operation(summary = "임시 로그인/회원가입(토큰 발급) API", description = "로그인 또는 회원가입 후 토큰을 발급한다.")
@ApiResponse(useReturnTypeSchema = true)
@PostMapping("/token")
public ResponseEntity<String> swaggerToken(@RequestBody LoginRequest loginRequest) {
String accessToken = authService.swaggerToken(loginRequest);
Expand Down
17 changes: 2 additions & 15 deletions src/main/java/com/dnd/gongmuin/mail/controller/MailController.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
import com.dnd.gongmuin.mail.service.MailService;

import io.swagger.v3.oas.annotations.Operation;
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 io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
Expand All @@ -31,12 +28,7 @@ public class MailController {

@Operation(summary = "공무원 이메일 인증 코드 요청 API",
description = "요청 받은 이메일 중복 가입 여부를 검증하고, 해당 이메일로 인증 코드 이메일 발송한다.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "인증 코드 요청 성공", content = {
@Content(schema = @Schema(implementation = SendMailResponse.class))
}),
@ApiResponse(responseCode = "400", description = "이미 존재하는 공무원 이메일, 발송 메일 설정 오류, 인증 코드 생성 실패")
})
@ApiResponse(useReturnTypeSchema = true)
@PostMapping
public ResponseEntity<SendMailResponse> sendAuthCodeToMail(
@RequestBody @Valid SendMailRequest sendMailRequest) {
Expand All @@ -45,12 +37,7 @@ public ResponseEntity<SendMailResponse> sendAuthCodeToMail(
}

@Operation(summary = "공무원 이메일 인증 코드 검증 API", description = "인증 코드의 일치 여부를 검증한다.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "인증 코드 검증 성공", content = {
@Content(schema = @Schema(implementation = AuthCodeResponse.class))
}),
@ApiResponse(responseCode = "400", description = "만료된 인증 코드, 인증 코드 검증 오류")
})
@ApiResponse(useReturnTypeSchema = true)
@PostMapping("/authCode")
public ResponseEntity<AuthCodeResponse> verifyMailAuthCode(
@RequestBody @Valid AuthCodeRequest authCodeRequest) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
package com.dnd.gongmuin.mail.dto.request;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;

@Schema(description = "인증 코드 검증 RequestDTO")
public record AuthCodeRequest(
@NotBlank(message = "인증 코드를 입력해주세요.")
@Pattern(regexp = "\\d{6}", message = "인증 코드는 6자리 숫자여야 합니다.")
@Schema(description = "인증 코드(6자리 숫자)")
String authCode,

@NotBlank(message = "공무원 이메일을 입력해주세요.")
@Email
@Schema(description = "인증 코드 받은 공무원 이메일")
String targetEmail
) {
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
package com.dnd.gongmuin.mail.dto.request;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;

@Schema(description = "이메일 인증 코드 요청 RequestDTO")
public record SendMailRequest(
@NotBlank(message = "공무원 이메일을 입력해주세요.")
@Email
@Schema(description = "수신 받을 공무원 이메일", example = "[email protected]")
String targetEmail
) {
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package com.dnd.gongmuin.mail.dto.response;

import io.swagger.v3.oas.annotations.media.Schema;

@Schema(description = "인증 코드 검증 응답 ResponseDTO")
public record AuthCodeResponse(
@Schema(description = "성공 시 true, 실패 시 false 반환")
boolean result
) {
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package com.dnd.gongmuin.mail.dto.response;

import io.swagger.v3.oas.annotations.media.Schema;

@Schema(description = "이메일 인증 코드 응답 ResponseDTO")
public record SendMailResponse(
@Schema(description = "발송 된 공무원 이메일", example = "[email protected]")
String targetEmail
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
import com.dnd.gongmuin.member.service.MemberService;

import io.swagger.v3.oas.annotations.Operation;
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 io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
Expand All @@ -36,23 +33,15 @@ public class MemberController {
private final MemberService memberService;

@Operation(summary = "닉네임 중복 검증 API", description = "닉네임 중복을 검증한다.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "닉네임 중복 검증 결과 값", content = {
@Content(schema = @Schema(implementation = ValidateNickNameResponse.class))
}),})
@ApiResponse(useReturnTypeSchema = true)
@PostMapping("/check-nickname")
public ResponseEntity<ValidateNickNameResponse> checkNickName(
@RequestBody @Valid ValidateNickNameRequest validateNickNameRequest) {
return ResponseEntity.ok(memberService.isDuplicatedNickname(validateNickNameRequest));
}

@Operation(summary = "회원가입 API", description = "회원가입을 진행한다.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "회원가입 성공", content = {
@Content(schema = @Schema(implementation = SignUpResponse.class))
}),
@ApiResponse(responseCode = "400", description = "소셜 로그인 회원 찾기 실패, 신규 회원이 아닌 기존 회원")
})
@Operation(summary = "추가정보 API", description = "추가 정보를 저장한다.")
@ApiResponse(useReturnTypeSchema = true)
@PostMapping("/member")
public ResponseEntity<SignUpResponse> signUp(
@RequestBody @Valid AdditionalInfoRequest request,
Expand All @@ -63,26 +52,15 @@ public ResponseEntity<SignUpResponse> signUp(
}

@Operation(summary = "로그아웃 API", description = "로그아웃한다.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "로그아웃 결과", content = {
@Content(schema = @Schema(implementation = LogoutResponse.class))
}),
@ApiResponse(responseCode = "400", description = "잘못된 토큰, 로그아웃 토큰(블랙리스트) 저장 실패, 로그아웃 실패")
})
@ApiResponse(useReturnTypeSchema = true)
@PostMapping("/logout")
public ResponseEntity<LogoutResponse> logout(@RequestBody @Valid LogoutRequest request) {
LogoutResponse response = memberService.logout(request);
return ResponseEntity.ok(response);
}

@Operation(summary = "토큰 재발급 API", description = "토큰을 재발급한다.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "재발급 된 토큰", content = {
@Content(schema = @Schema(implementation = ReissueResponse.class))
}),
@ApiResponse(responseCode = "400",
description = "잘못된 토큰(로그아웃(블랙리스트) 토큰 또는 refreshToken 만료), 토큰 재발급 중 오류")
})
@ApiResponse(useReturnTypeSchema = true)
@PostMapping("/reissue/token")
public ResponseEntity<ReissueResponse> reissue(@RequestBody @Valid ReissueRequest request) {
ReissueResponse response = memberService.reissue(request);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
package com.dnd.gongmuin.member.dto.request;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;

@Schema(description = "회원가입 RequestDTO")
public record AdditionalInfoRequest(

@NotBlank(message = "공무원 이메일은 필수 입력 항목입니다.")
@Schema(description = "중복 및 인증 코드가 검증된 공무원 이메일")
String officialEmail,

@NotBlank(message = "닉네임은 필수 입력 항목입니다.")
@Size(min = 2, max = 12, message = "닉네임은 최소 2자리 이상 최대 12자 이하입니다.")
@Schema(description = "중복 검증 된 닉네임")
String nickname,

@NotBlank(message = "직군은 필수 입력 항목입니다.")
@Schema(description = "직군")
String jobGroup,

@NotBlank(message = "직렬은 필수 입력 항목입니다.")
@Schema(description = "직렬")
String jobCategory
) {
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
package com.dnd.gongmuin.member.dto.request;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;

@Schema(description = "로그아웃 RequestDTO")
public record LogoutRequest(

@NotEmpty(message = "AccessToken을 입력해주세요.")
@Schema(description = "이전에 발급된 AccessToken")
String accessToken
) {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
package com.dnd.gongmuin.member.dto.request;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;

@Schema(description = "토큰 재발급 RequestDTO")
public record ReissueRequest(

@NotEmpty(message = "AccessToken을 입력해주세요.")
@Schema(description = "이전에 발급된 AccessToken")
String accessToken
) {
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
package com.dnd.gongmuin.member.dto.request;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;

@Schema(description = "닉네임 중복 검증 RequestDTO")
public record ValidateNickNameRequest(

@NotBlank(message = "닉네임은 필수 입력 항목입니다.")
@Size(min = 2, max = 12, message = "닉네임은 최소 2자리 이상 최대 12자 이하입니다.")
@Schema(description = "중복 검증할 닉네임")
String nickname
) {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
package com.dnd.gongmuin.member.dto.response;

import io.swagger.v3.oas.annotations.media.Schema;

@Schema(description = " ResponseDTO")
public record LogoutResponse(

@Schema(description = "로그아웃 성공 시 true, 실패 시 false")
boolean result
) {
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
package com.dnd.gongmuin.member.dto.response;

import io.swagger.v3.oas.annotations.media.Schema;

@Schema(description = " ResponseDTO")
public record ReissueResponse(

@Schema(description = "재발급 된 accessToken")
String accessToken
) {
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
package com.dnd.gongmuin.member.dto.response;

import io.swagger.v3.oas.annotations.media.Schema;

@Schema(description = " ResponseDTO")
public record SignUpResponse(

@Schema(description = "회원가입 요청한 닉네임")
String nickName
) {
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
package com.dnd.gongmuin.member.dto.response;

import io.swagger.v3.oas.annotations.media.Schema;

@Schema(description = " ResponseDTO")
public record ValidateNickNameResponse(

@Schema(description = "중복이 아니면 true, 중복이면 false")
boolean isDuplicated
) {
}

0 comments on commit af12041

Please sign in to comment.