package com.zhentao.web.controller.system;

import com.zhentao.common.annotation.Anonymous;
import com.zhentao.common.core.controller.BaseController;
import com.zhentao.common.core.domain.AjaxResult;
import com.zhentao.common.core.page.TableDataInfo;
import com.zhentao.system.domain.Course;
import com.zhentao.system.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: wzy
 * @date: 2025/5/8 16:14
 */
@RestController
@Anonymous
@RequestMapping("/system/course")
public class CourseController extends BaseController {
    @Autowired
    private CourseService courseService;

    /**
     * 课程列表查询
     * @param course
     * @return
     */
    @RequestMapping("/list")
    public TableDataInfo list(Course course){
        startPage();
        List<Course> courseList = courseService.selectCourseList(course);
        return getDataTable(courseList);
    }

    @RequestMapping("/findById")
    public AjaxResult findById(Integer courseCategory){
        List<Course> byId = courseService.findById(courseCategory);
        return AjaxResult.success(byId);
    }
}
