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.CourseBusinessAddBo;
import com.zhongzheng.modules.course.bo.CourseBusinessEditBo;
import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
import com.zhongzheng.modules.course.service.ICourseBusinessService;
import com.zhongzheng.modules.course.vo.CourseBusinessVo;
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/business")
public class CourseBusinessController extends BaseController {

    private final ICourseBusinessService iCourseBusinessService;

    /**
     * 查询业务层次列表
     */
    @ApiOperation("查询业务层次列表")
    @GetMapping("/list")
    public TableDataInfo<CourseBusinessVo> list(CourseBusinessQueryBo bo) {
        bo.setStatus(new ArrayList<Integer>(Arrays.asList(1)));
        startPage();
        List<CourseBusinessVo> list = iCourseBusinessService.queryList(bo);
        return getDataTable(list);
    }

}
