login
This commit is contained in:
@@ -11,34 +11,19 @@ import java.util.Map;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
|
||||
|
||||
@RestController
|
||||
public class LoginController {
|
||||
|
||||
@PostMapping("login/oauth-kakao")
|
||||
public Map<String, Object> kakaoLogin(ResponseBody entity) {
|
||||
System.out.println(entity);
|
||||
HttpClient client = HttpClient.newHttpClient();
|
||||
Map<String, Object> returnValue = new HashMap<>();
|
||||
HttpRequest request = HttpRequest.newBuilder()
|
||||
.uri(URI.create("https://kauth.kakao.com/oauth/authorize"))
|
||||
.GET()
|
||||
.header("Content-Type", "application/json")
|
||||
.build();
|
||||
try {
|
||||
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
|
||||
System.out.println("response body :: " + response.body());
|
||||
returnValue.put("body", response.body());
|
||||
returnValue.put("status", response.statusCode());
|
||||
returnValue.put("headers", response.headers());
|
||||
|
||||
} catch (InterruptedException e) {
|
||||
System.out.println(e.getMessage());
|
||||
} catch (IOException e) {
|
||||
System.out.println(e.getMessage());
|
||||
}
|
||||
return returnValue;
|
||||
@GetMapping("login/oauth-kakao")
|
||||
public String kakaoLogiString(@RequestParam String param) {
|
||||
System.out.println("getmethod");
|
||||
System.out.println(param);
|
||||
return param;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user