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

View File

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

View File

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