package com.zhongzheng.controller.course;

import com.zhongzheng.common.annotation.Log;
import com.zhongzheng.common.core.controller.BaseController;
import com.zhongzheng.common.core.domain.AjaxResult;
import com.zhongzheng.common.core.page.TableDataInfo;
import com.zhongzheng.common.enums.BusinessType;
import com.zhongzheng.modules.course.bo.MajorExamineAddBo;
import com.zhongzheng.modules.course.bo.MajorExamineEditBo;
import com.zhongzheng.modules.course.bo.MajorExamineQueryBo;
import com.zhongzheng.modules.course.service.IMajorExamineService;
import com.zhongzheng.modules.course.vo.MajorExamineVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 考期Controller
 * 
 * @author ruoyi
 * @date 2021-10-09
 */
@Api(value = "考期控制器", tags = {"考期管理"})
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/course/examine")
public class MajorExamineController extends BaseController {

    private final IMajorExamineService iMajorExamineService;

    /**
     * 查询考期列表
     */
    @ApiOperation("查询考期列表")
    @GetMapping("/list")
    public TableDataInfo<MajorExamineVo> list(MajorExamineQueryBo bo) {
        startPage();
        List<MajorExamineVo> list = iMajorExamineService.queryList(bo);
        return getDataTable(list);
    }


    /**
     * 获取考期详细信息
     */
    @ApiOperation("获取考期详细信息")
    @GetMapping("/{id}")
    public AjaxResult<MajorExamineVo> getInfo(@PathVariable("id" ) Long id) {
        return AjaxResult.success(iMajorExamineService.queryById(id));
    }


}
