package org.dromara.main.controller;

import jakarta.validation.constraints.NotNull;
import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R;
import org.dromara.common.web.core.BaseController;
import org.dromara.main.domain.vo.MainTrainingLearnRecordVo;
import org.dromara.main.service.IMainTrainingLearnRecordService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 培训学习记录控制器
 *
 * @author ruoyi
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/main/training-learn-record")
public class MainTrainingLearnRecordController extends BaseController {

    private final IMainTrainingLearnRecordService learnRecordService;

    /**
     * 查询学员培训学习记录列表
     */
    @GetMapping("/list")
    public R<List<MainTrainingLearnRecordVo>> list(@NotNull(message = "学员ID不能为空") @RequestParam Long studentId) {
        return R.ok(learnRecordService.queryRecordListByStudentId(studentId));
    }
}
