package com.zhongzheng.controller.grade;

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.common.utils.DateUtils;
import com.zhongzheng.common.utils.ServletUtils;
import com.zhongzheng.modules.grade.bo.*;
import com.zhongzheng.modules.grade.service.*;
import com.zhongzheng.modules.grade.vo.*;
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-11-10
 */
@Api(value = "班级控制器", tags = {"班级管理"})
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/grade/grade")
public class ClassGradeController extends BaseController {

    private final IClassGradeService iClassGradeService;

    private final IClassGradeInterfaceService iClassGradeInterfaceService;

    private final IClassGradeSysService iClassGradeSysService;

    private final IClassGradeUserService iClassGradeUserService;

    private final IUserPeriodService iUserPeriodService;

    private final IUserPeriodStatusService userPeriodStatusService;

    /**
     * 查询班级列表
     */
    @ApiOperation("查询班级列表")
    @GetMapping("/list")
    public TableDataInfo<ClassGradeVo> list(ClassGradeQueryBo bo) {
        startPage();
        bo.setClassStartTime(DateUtils.getNowTime());
        bo.setClassEndTime(DateUtils.getNowTime());
        bo.setStatus(new ArrayList<Integer>(Arrays.asList(1)));
        bo.setPastDue(1L);
        List<ClassGradeVo> list = iClassGradeService.queryList(bo);
        return getDataTable(list);
    }

}
