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.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
public class LoginController {
|
public class LoginController {
|
||||||
|
|
||||||
@PostMapping("login/oauth-kakao")
|
@GetMapping("login/oauth-kakao")
|
||||||
public Map<String, Object> kakaoLogin(ResponseBody entity) {
|
public String kakaoLogiString(@RequestParam String param) {
|
||||||
System.out.println(entity);
|
System.out.println("getmethod");
|
||||||
HttpClient client = HttpClient.newHttpClient();
|
System.out.println(param);
|
||||||
Map<String, Object> returnValue = new HashMap<>();
|
return param;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
spring:
|
spring:
|
||||||
profiles: DEV
|
config:
|
||||||
|
activate:
|
||||||
|
on-profile:
|
||||||
|
- DEV
|
||||||
server:
|
server:
|
||||||
port: 9001
|
port: 9001
|
||||||
logging:
|
logging:
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#로컬 실행시 기본 프로필
|
#로컬 실행시 기본 프로필
|
||||||
spring:
|
spring:
|
||||||
config:
|
profiles:
|
||||||
activate:
|
active:
|
||||||
on-profile:
|
|
||||||
- DEV
|
- DEV
|
||||||
Reference in New Issue
Block a user