package com.zhongzheng.controller.exam;

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.exam.bo.ExamPaperAddBo;
import com.zhongzheng.modules.exam.bo.ExamPaperEditBo;
import com.zhongzheng.modules.exam.bo.ExamPaperQueryBo;
import com.zhongzheng.modules.exam.service.IExamPaperService;
import com.zhongzheng.modules.exam.vo.ExamPaperVo;
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.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 试卷类型Controller
 *
 * @author ruoyi
 * @date 2021-10-18
 */
@Api(value = "试卷类型控制器", tags = {"试卷类型管理"})
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/exam/paper")
public class ExamPaperController extends BaseController {

    private final IExamPaperService iExamPaperService;

    /**
     * 查询试卷类型列表
     */
    @ApiOperation("查询试卷类型列表")
    @GetMapping("/list")
    public TableDataInfo<ExamPaperVo> list(ExamPaperQueryBo bo) {
        bo.setStatus(new ArrayList<Integer>(Arrays.asList(1)));
        startPage();
        List<ExamPaperVo> list = iExamPaperService.queryList(bo);
        return getDataTable(list);
    }


}
