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.CourseEducationTypeAddBo;
import com.zhongzheng.modules.course.bo.CourseEducationTypeEditBo;
import com.zhongzheng.modules.course.bo.CourseEducationTypeQueryBo;
import com.zhongzheng.modules.course.service.ICourseEducationTypeService;
import com.zhongzheng.modules.course.vo.CourseEducationTypeVo;
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-08
 */
@Api(value = "教育类型控制器", tags = {"教育类型管理"})
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/app/common/course/educationType")
public class CourseEducationTypeController extends BaseController {

    private final ICourseEducationTypeService iCourseEducationTypeService;

    /**
     * 查询教育类型列表
     */
    @ApiOperation("查询教育类型列表")
    @GetMapping("/list")
    public TableDataInfo<CourseEducationTypeVo> list(CourseEducationTypeQueryBo bo) {
        bo.setStatus(new ArrayList<Integer>(Arrays.asList(1)));
        startPage();
        List<CourseEducationTypeVo> list = iCourseEducationTypeService.queryList(bo);
        return getDataTable(list);
    }
}
