package com.ruoyi.web.modules.technology.controller;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.web.modules.technology.domain.OnlineTrainingCourseQuery;
import com.ruoyi.web.modules.technology.service.IBizOnlineTrainingCourseService;

/**
 * 网上培训课程（只读，数据来自已发布视频课程库）
 */
@RestController
@RequestMapping("/techService/onlineTrainingCourse")
public class BizOnlineTrainingCourseController extends BaseController
{
    @Autowired
    private IBizOnlineTrainingCourseService onlineTrainingCourseService;

    @PreAuthorize("@ss.hasPermi('techService:onlineTrainingCourse:list')")
    @GetMapping("/list")
    public TableDataInfo list(OnlineTrainingCourseQuery query)
    {
        startPage();
        List<?> list = onlineTrainingCourseService.selectOnlineTrainingCourseList(query);
        return getDataTable(list);
    }

    @PreAuthorize("@ss.hasPermi('techService:onlineTrainingCourse:list')")
    @GetMapping("/courseTopics")
    public AjaxResult courseTopics()
    {
        return success(onlineTrainingCourseService.selectCourseTopics());
    }

    @PreAuthorize("@ss.hasPermi('techService:onlineTrainingCourse:query')")
    @GetMapping("/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(onlineTrainingCourseService.selectOnlineTrainingCourseById(id));
    }
}
