Skip to content

Commit

Permalink
feat : kakaoLogin
Browse files Browse the repository at this point in the history
  • Loading branch information
oU-Ua committed Jan 22, 2024
1 parent 832c0bf commit 2c39e01
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/main/java/mvc/promiseme/users/controller/UserController.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import mvc.promiseme.common.exception.ErrorResponse;
import mvc.promiseme.kakao.KakaoApi;
import mvc.promiseme.project.dto.ProjectResponseDTO;
import mvc.promiseme.users.dto.KakaoResponseDTO;
import mvc.promiseme.users.dto.LoginRequestDTO;
import mvc.promiseme.users.dto.LoginResponseDTO;
import mvc.promiseme.users.dto.UserDTO;
Expand Down Expand Up @@ -63,14 +64,13 @@ public class UserController {

@Operation(summary = "카카오로그인", description = "카카오 로그인 창으로 이동 ")
@ApiResponses({
@ApiResponse(responseCode = "200", description = "성공", content = @Content(schema = @Schema(implementation = Map.class))),
@ApiResponse(responseCode = "200", description = "성공", content = @Content(schema = @Schema(implementation = Map.class)))
})
@GetMapping("user/loginKakao")
public ResponseEntity<Map<String,String>> kakaoLogin(){
Map<String,String> map = new HashMap<>();
map.put("kakaoApiKey", kakaoApi.getKakaoApiKey());
map.put("redirectUri", kakaoApi.getKakaoRedirectUri());
return ResponseEntity.ok(map);
@PostMapping("user/loginKakao")
public ResponseEntity<KakaoResponseDTO> kakaoLogin(){
KakaoResponseDTO kakaoResponseDTO = new KakaoResponseDTO(kakaoApi.getKakaoApiKey(),kakaoApi.getKakaoRedirectUri());

return ResponseEntity.ok(kakaoResponseDTO);
}

@GetMapping("/login/oauth/kakao")
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/mvc/promiseme/users/dto/KakaoResponseDTO.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package mvc.promiseme.users.dto;

import lombok.*;

@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
@Builder
public class KakaoResponseDTO {
private String kakaoApiKey;
private String redirectUri;
// private String token;
}

0 comments on commit 2c39e01

Please sign in to comment.