package com.seer.teach.teacher.controller.app;

import com.seer.teach.common.ResultBean;
import com.seer.teach.common.annotation.DecryptionAnnotation;
import com.seer.teach.common.annotation.EncryptionAnnotation;
import com.seer.teach.common.annotation.LogPrint;
import com.seer.teach.teacher.common.resp.SubjectResp;
import com.seer.teach.teacher.service.SubjectsService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: Captain
 * @Description: 预习Controller
 * @Date: 2025-06-12 13:57
 */
@RequestMapping("/app/subject")
@RestController
@Tag(name = "APP - 科目")
@Validated
@EncryptionAnnotation
@DecryptionAnnotation
@RequiredArgsConstructor
public class SubjectController {

    private final SubjectsService subjectsService;

    @PostMapping("/getCurrentSubjects")
    @Operation(summary = "获取用户当前科目")
    @LogPrint
    public ResultBean<List<SubjectResp>> getTypes() {
        List<SubjectResp> results = subjectsService.getUserSubjects();
        return ResultBean.success(results);
    }
}
