-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHomeController.java
More file actions
26 lines (22 loc) · 1.01 KB
/
HomeController.java
File metadata and controls
26 lines (22 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.example.enjoy.controller;
import com.example.enjoy.dto.TrackProgressDto;
import com.example.enjoy.service.TrackService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Tag(name = "홈 컨트롤러", description = "메인 화면 API")
@RestController
@RequiredArgsConstructor
public class HomeController {
private final TrackService trackService;
@Operation(summary = "트랙 진행률 조회", description = "현재 학생의 전체 트랙 진행률을 조회합니다.")
@GetMapping("/home")
public List<TrackProgressDto> showMyProgress() {
// TODO: 추후 Spring Security 등과 연동하여 실제 로그인한 사용자 ID를 가져와야 함
String currentStudentId = "1";
return trackService.calculateTrackProgress(currentStudentId);
}
}