Skip to content

Commit

Permalink
Merge pull request #2 from potenday-project/develop
Browse files Browse the repository at this point in the history
카카오 로그인 방식 자동 로그인이 아닌 코드 반환 및 코드로 로그인하도록 변경
  • Loading branch information
HwangHoYoon authored Dec 11, 2023
2 parents 93b0c98 + 6355811 commit 66dada8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,8 @@
import org.springframework.web.multipart.MultipartFile;

@Data
@Builder
public class ResumeUploadReq {

@Schema(description = "이력서파일", example = "이력서.pdf", name = "file")
private MultipartFile file;

@Schema(description = "아이디", example = "1", name = "userId")
private Long userId;

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class TmpController {

private final TmpService tmpService;

@Operation(summary = "Tmp 목록 조회", description = "Tmp 목록 조회")
@Operation(summary = "Tmp 목록 조회 (기본 테스트)", description = "Tmp 목록 조회 (기본 테스트)")
@GetMapping("/")
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")}
)
Expand Down
32 changes: 20 additions & 12 deletions src/main/java/com/chwipoClova/user/controller/UserController.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.chwipoClova.user.controller;

import com.chwipoClova.common.response.CommonResponse;
import com.chwipoClova.common.response.MessageCode;
import com.chwipoClova.user.request.UserLoginReq;
import com.chwipoClova.user.response.UserInfoRes;
import com.chwipoClova.user.response.UserLoginRes;
import com.chwipoClova.user.response.UserSnsUrlRes;
Expand Down Expand Up @@ -31,6 +29,18 @@ public class UserController {

private final UserService userService;

@Operation(summary = "유저 정보 조회 (테스트용)", description = "유저 정보 조회 (테스트용)")
@GetMapping("/getUserInfo")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "OK")
}
)
public UserInfoRes getUserInfo(
@Schema(description = "이메일", example = "[email protected]", name = "email") @RequestParam(name = "email") String email
) {
return userService.selectUserInfo(email);
}

@Operation(summary = "카카오 로그인 URL", description = "카카오 로그인 URL")
@GetMapping("/getKakaoUrl")
@ApiResponses(value = {
Expand All @@ -41,27 +51,25 @@ public UserSnsUrlRes getKakaoUrl() throws Exception {
return userService.getKakaoUrl();
}

@Operation(summary = "카카오 로그인", description = "카카오 로그인")
@GetMapping("/kakaoCallback")
@Operation(summary = "카카오 로그인", description = "카카오 로그인 (카카오 로그인 URL 호출해서 로그인 성공하면 나오는 코드를 입력)")
@GetMapping("/kakaoLogin")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = UserLoginRes.class))),
@ApiResponse(responseCode = "700", description = "신규 가입되었습니다.", content = @Content(schema = @Schema(implementation = String.class)))
}
)
public CommonResponse kakaoCallback(@Schema(description = "로그인코드", example = "1", name = "code") @RequestParam(name = "code") String code, HttpServletResponse response) throws Exception {
public CommonResponse kakaoLogin(@Schema(description = "로그인코드", example = "1", name = "code") @RequestParam(name = "code") String code, HttpServletResponse response) throws Exception {
return userService.kakaoLogin(code, response);
}


@Operation(summary = "유저 정보 조회 (테스트용)", description = "유저 정보 조회 (테스트용)")
@GetMapping("/getUserInfo")
@Hidden
@Operation(summary = "카카오 로그인 콜백", description = "카카오 로그인 콜백")
@GetMapping("/kakaoCallback")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "OK")
}
)
public UserInfoRes getUserInfo(
@Schema(description = "이메일", example = "[email protected]", name = "email") @RequestParam(name = "email") String email
) {
return userService.selectUserInfo(email);
public String kakaoCallback(@Schema(description = "로그인코드", example = "1", name = "code") @RequestParam(name = "code") String code, HttpServletResponse response) throws Exception {
return code;
}
}

0 comments on commit 66dada8

Please sign in to comment.