package com.zhongzheng.controller.course;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
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.TeacherAddBo;
import com.zhongzheng.modules.course.bo.TeacherEditBo;
import com.zhongzheng.modules.course.bo.TeacherQueryBo;
import com.zhongzheng.modules.course.service.ITeacherService;
import com.zhongzheng.modules.course.vo.TeacherVo;
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.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
 * 名师Controller
 *
 * @author hjl
 * @date 2021-05-19
 */
@Api(value = "名师控制器", tags = {"名师管理"})
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/app/common/course/teacher")
public class TeacherController extends BaseController {

    private final ITeacherService iTeacherService;

    /**
     * 查询名师列表
     */
    @ApiOperation("查询名师列表")
    @GetMapping("/list")
    public TableDataInfo<TeacherVo> list(TeacherQueryBo bo) {
        List<Integer> statusList = new ArrayList<>();
        statusList.add(1);
        bo.setStatus(statusList);
        startPage();
        List<TeacherVo> list = iTeacherService.queryList(bo);
        return getDataTable(list);
    }

}
