From b908aa27f08ea6f8644801267a302d487299a56e Mon Sep 17 00:00:00 2001 From: parkrootseok Date: Thu, 23 Mar 2023 19:05:35 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[Add]=20#3=20-=20=ED=9A=8C=EC=9B=90=20?= =?UTF-8?q?=EA=B0=80=EC=9E=85=20API=20Swagger=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/user/api/UserApiController.java | 25 +++++++++++++++++++ .../domain/user/dto/PostUserReq.java | 25 +++++++++++++++++++ .../domain/user/dto/PostUserRes.java | 17 +++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 src/main/java/org/interviewmate/domain/user/api/UserApiController.java create mode 100644 src/main/java/org/interviewmate/domain/user/dto/PostUserReq.java create mode 100644 src/main/java/org/interviewmate/domain/user/dto/PostUserRes.java diff --git a/src/main/java/org/interviewmate/domain/user/api/UserApiController.java b/src/main/java/org/interviewmate/domain/user/api/UserApiController.java new file mode 100644 index 0000000..6a0cf8c --- /dev/null +++ b/src/main/java/org/interviewmate/domain/user/api/UserApiController.java @@ -0,0 +1,25 @@ +package org.interviewmate.domain.user.api; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import org.interviewmate.domain.user.dto.PostUserReq; +import org.interviewmate.domain.user.dto.PostUserRes; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@Tag(name = "유저 관련 API") +@RestController +@RequestMapping("/users") +@RequiredArgsConstructor +public class UserApiController { + + @Operation(summary = "회원 가입 API", description = "필요한 정보를 받아 회원 가입 진행") + @PostMapping("/sign-up") + public PostUserRes signUp(@RequestBody PostUserReq postUserReq) { + return null; + } + +} diff --git a/src/main/java/org/interviewmate/domain/user/dto/PostUserReq.java b/src/main/java/org/interviewmate/domain/user/dto/PostUserReq.java new file mode 100644 index 0000000..8b043d4 --- /dev/null +++ b/src/main/java/org/interviewmate/domain/user/dto/PostUserReq.java @@ -0,0 +1,25 @@ +package org.interviewmate.domain.user.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.List; +import lombok.Getter; + +@Schema(name = "회원 가입 Request", description = "회원 가입에 필요한 유저에 대한 정보") +@Getter +public class PostUserReq { + + @Schema(description = "이메일", example = "moa.moa.interview@gmail.com") + private String email; + @Schema(description = "비밀번호", example = "Moamoa0302!") + private String password; + + @Schema(description = "닉네임", example = "모아모아뀽") + private String nickName; + + @Schema(description = "직무", example = "서버 개발자") + private String job; + + @Schema(description = "키워드", example = "{Spring, JPA, Java}") + private List keyword; + +} diff --git a/src/main/java/org/interviewmate/domain/user/dto/PostUserRes.java b/src/main/java/org/interviewmate/domain/user/dto/PostUserRes.java new file mode 100644 index 0000000..d6b2847 --- /dev/null +++ b/src/main/java/org/interviewmate/domain/user/dto/PostUserRes.java @@ -0,0 +1,17 @@ +package org.interviewmate.domain.user.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; + +@Schema(name = "회원 가입 Response", description = "회원 가입을 완료한 유저에 대한 정보") +@Getter +public class PostUserRes { + + @Schema(description = "유저 식별자", example = "1") + private Long userId; + @Schema(description = "이메일", example = "moa.moa.interview@gmail.com") + private String email; + @Schema(description = "비밀번호", example = "Moamoa0302!") + private String password; + +} From 476392f5b1ce99e7474ec62fe030afc230cf6945 Mon Sep 17 00:00:00 2001 From: parkrootseok Date: Thu, 23 Mar 2023 19:14:31 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[Add]=20#3=20-=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=9D=B8=20API=20Swagger=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/auth/api/AuthApiController.java | 25 +++++++++++++++++++ .../domain/auth/dto/LoginReq.java | 16 ++++++++++++ .../domain/auth/dto/LoginRes.java | 18 +++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 src/main/java/org/interviewmate/domain/auth/api/AuthApiController.java create mode 100644 src/main/java/org/interviewmate/domain/auth/dto/LoginReq.java create mode 100644 src/main/java/org/interviewmate/domain/auth/dto/LoginRes.java diff --git a/src/main/java/org/interviewmate/domain/auth/api/AuthApiController.java b/src/main/java/org/interviewmate/domain/auth/api/AuthApiController.java new file mode 100644 index 0000000..a9d62c2 --- /dev/null +++ b/src/main/java/org/interviewmate/domain/auth/api/AuthApiController.java @@ -0,0 +1,25 @@ +package org.interviewmate.domain.auth.api; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import org.interviewmate.domain.auth.dto.LoginReq; +import org.interviewmate.domain.auth.dto.LoginRes; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@Tag(name = "인증 관련 API") +@RestController +@RequestMapping("/auth") +@RequiredArgsConstructor +public class AuthApiController { + + @Operation(summary = "로그인 API", description = "필요한 정보를 받아 로그인 진행") + @PostMapping("/login") + public LoginRes signUp(@RequestBody LoginReq loginReq) { + return null; + } + +} diff --git a/src/main/java/org/interviewmate/domain/auth/dto/LoginReq.java b/src/main/java/org/interviewmate/domain/auth/dto/LoginReq.java new file mode 100644 index 0000000..4e942d9 --- /dev/null +++ b/src/main/java/org/interviewmate/domain/auth/dto/LoginReq.java @@ -0,0 +1,16 @@ +package org.interviewmate.domain.auth.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.List; +import lombok.Getter; + +@Schema(name = "로그인 Request", description = "로그인에 필요한 정보") +@Getter +public class LoginReq { + + @Schema(description = "이메일", example = "moa.moa.interview@gmail.com") + private String email; + @Schema(description = "비밀번호", example = "Moamoa0302!") + private String password; + +} diff --git a/src/main/java/org/interviewmate/domain/auth/dto/LoginRes.java b/src/main/java/org/interviewmate/domain/auth/dto/LoginRes.java new file mode 100644 index 0000000..ef5fdb4 --- /dev/null +++ b/src/main/java/org/interviewmate/domain/auth/dto/LoginRes.java @@ -0,0 +1,18 @@ +package org.interviewmate.domain.auth.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; + +@Schema(name = "로그인 Response", description = "로그인 결과에 대한 정보") +@Getter +public class LoginRes { + + @Schema(description = "유저 식별자", example = "1") + private Long userId; + @Schema(description = "Access 토큰", example = "eyJ0eXBlIjoiand0IiwiYWxnIjoiSFMyNTYifQ.eyJpYXQiOjE2Nzk1NjYzOTEsImV4cCI6MTY3OTU2ODE5MSwidXNlcklkeCI6MjB9.-Ji4Cw5S8qGbCrNs9MlEyqACEIYH6qZKSsJRobFzY_w") + private String accessToken; + @Schema(description = "Refresh 토큰", example = "eyJ0eXBlIjoiand0IiwiYWxnIjoiSFMyNTYifQ.eyJpYXQiOjE2Nzk1NjYzOTEsImV4cCI6MTY4MDE3MTE5MX0.cRQqbqLYsbVfYUMj7WQd-IlhMl_-pEC-BOYrIA0TNPc") + private String refreshToken; + + +}