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.MajorCategoryAddBo;
import com.zhongzheng.modules.course.bo.MajorCategoryEditBo;
import com.zhongzheng.modules.course.bo.MajorCategoryQueryBo;
import com.zhongzheng.modules.course.service.IMajorCategoryService;
import com.zhongzheng.modules.course.vo.MajorCategoryVo;
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.List;

/**
 * 【专业分类】Controller
 *
 * @author hjl
 * @date 2021-05-13
 */
@Api(value = "【专业分类】控制器", tags = {"专业分类"})
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/course/category")
public class MajorCategoryController extends BaseController {

    private final IMajorCategoryService iMajorCategoryService;

    /**
     * 查询【专业分类】列表
     */
    @ApiOperation("查询【专业分类】列表")
    @GetMapping("/list")
    public TableDataInfo<MajorCategoryVo> list(MajorCategoryQueryBo bo) {
        startPage();
        List<MajorCategoryVo> list = iMajorCategoryService.queryList(bo);
        return getDataTable(list);
    }

    /**
     * 获取【专业分类】详细信息
     */
    @ApiOperation("获取【专业分类】详细信息")
    @GetMapping("/{categoryId}")
    public AjaxResult<MajorCategoryVo> getInfo(@PathVariable("categoryId" ) Long categoryId) {
        return AjaxResult.success(iMajorCategoryService.queryById(categoryId));
    }




}
