Skip to content

Commit

Permalink
Merge pull request #16 from Interviewmate/feature/login
Browse files Browse the repository at this point in the history
로그인 API Swagger 반영
  • Loading branch information
parkrootseok authored Mar 23, 2023
2 parents 5c13bdb + 476392f commit 24316d0
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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;
}

}
16 changes: 16 additions & 0 deletions src/main/java/org/interviewmate/domain/auth/dto/LoginReq.java
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]")
private String email;
@Schema(description = "비밀번호", example = "Moamoa0302!")
private String password;

}
18 changes: 18 additions & 0 deletions src/main/java/org/interviewmate/domain/auth/dto/LoginRes.java
Original file line number Diff line number Diff line change
@@ -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;


}

0 comments on commit 24316d0

Please sign in to comment.