-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKakaoController.java
More file actions
28 lines (22 loc) · 930 Bytes
/
KakaoController.java
File metadata and controls
28 lines (22 loc) · 930 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package com.example.profileem.controller;
import com.example.profileem.service.KakaoService;
import lombok.RequiredArgsConstructor;
import io.swagger.v3.oas.annotations.*;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequiredArgsConstructor
@RequestMapping("/oauth2")
@Tag(name = "Kakao")
public class KakaoController {
public final KakaoService kakaoService;
@Operation(summary = "카카오 로그인", description = "카카오 로그인")
@GetMapping("/kakao")
public Long kakaoLogin(@RequestHeader(value = "AccessToken") String accessToken) {
Long userId = kakaoService.createKakaoUser(accessToken);
return userId;
}
}