This commit is contained in:
root
2025-07-30 12:59:47 +09:00
parent 8dc0bac98c
commit 79b98f4321
3 changed files with 15 additions and 28 deletions

View File

@@ -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;
} }
} }

View File

@@ -1,5 +1,8 @@
spring: spring:
profiles: DEV config:
activate:
on-profile:
- DEV
server: server:
port: 9001 port: 9001
logging: logging:

View File

@@ -1,6 +1,5 @@
#로컬 실행시 기본 프로필 #로컬 실행시 기본 프로필
spring: spring:
config: profiles:
activate: active:
on-profile:
- DEV - DEV