package com.ym.mec.web.controller;

import com.ym.mec.biz.dal.page.TeacherCourseStatisticsQueryInfo;
import com.ym.mec.biz.service.OrganizationService;
import com.ym.mec.biz.service.TeacherCourseStatisticsService;
import com.ym.mec.common.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RequestMapping("teacherCourseStatistics")
@Api(tags = "教师排课统计服务")
@RestController
public class TeacherCourseStatisticsController extends BaseController {

    @Autowired
    private OrganizationService organizationService;
    @Autowired
    private TeacherCourseStatisticsService teacherCourseStatisticsService;

    @ApiOperation(value = "分页查询教师列表")
    @GetMapping("/queryPage")
    @PreAuthorize("@pcs.hasPermissions('teacherCourseStatistics/queryPage')")
    public Object queryPage(TeacherCourseStatisticsQueryInfo queryInfo) {
        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
        return succeed(teacherCourseStatisticsService.queryPageDetail(queryInfo));
    }
}
