package com.seer.teach.admin.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.seer.teach.common.ResultBean;
import com.seer.teach.common.utils.SubjectUtils;
import com.seer.teach.common.utils.dto.SubjectDTO;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 后台-科目管理控制器
 * </p>
 *
 * @author System
 * @since 2025-10-25
 */
@Tag(name = "管理端 - 科目管理")
@RestController
@RequiredArgsConstructor
@RequestMapping("/teacher/subject")
public class AdminSubjectsController {

    /**
     * 获取所有科目列表
     *
     * @return 科目列表响应结果
     */
    @GetMapping("/list")
    @Operation(summary = "获取所有科目列表")
    @SaCheckPermission("teacher:admin:subject:list")
    public ResultBean<List<SubjectDTO>> listSubjects() {
        return ResultBean.success(SubjectUtils.getList());
    }

}