From 16ab0f0980eda066b36b1e674f454f1b82faa95e Mon Sep 17 00:00:00 2001 From: Jiwoo Date: Wed, 25 Jun 2025 23:47:15 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20HomeController=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/example/enjoy/controller/HomeController.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/example/enjoy/controller/HomeController.java b/src/main/java/com/example/enjoy/controller/HomeController.java index 272d916..c4f2119 100644 --- a/src/main/java/com/example/enjoy/controller/HomeController.java +++ b/src/main/java/com/example/enjoy/controller/HomeController.java @@ -5,6 +5,8 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; @@ -19,8 +21,8 @@ public class HomeController { @Operation(summary = "트랙 진행률 조회", description = "현재 학생의 전체 트랙 진행률을 조회합니다.") @GetMapping("/home") public List showMyProgress() { - // TODO: 추후 Spring Security 등과 연동하여 실제 로그인한 사용자 ID를 가져와야 함 - String currentStudentId = "1"; + Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); + String currentStudentId = authentication.getName(); return trackService.calculateTrackProgress(currentStudentId); } } \ No newline at end of file