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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
spring:
|
||||
profiles: DEV
|
||||
config:
|
||||
activate:
|
||||
on-profile:
|
||||
- DEV
|
||||
server:
|
||||
port: 9001
|
||||
logging:
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#로컬 실행시 기본 프로필
|
||||
spring:
|
||||
config:
|
||||
activate:
|
||||
on-profile:
|
||||
profiles:
|
||||
active:
|
||||
- DEV
|
||||
Reference in New Issue
Block a user