package com.ym.mec.education.controller;

import com.ym.mec.education.base.PageResponse;
import com.ym.mec.education.req.ClassGroupReq;
import com.ym.mec.education.req.CourseScheduleReq;
import com.ym.mec.education.service.IStudentAttendanceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: mec
 * @description: 考勤记录
 * @author: xw
 * @create: 2019-09-25 21:22
 */
@RestController
@RequestMapping("api/studentAttendance")
@Api(tags = "学生考勤")
@Slf4j
public class StudentAttendanceController {

    @Autowired
    private IStudentAttendanceService studentAttendanceService;

    @PostMapping("/list")
    @ApiOperation("点名记录列表")
    public PageResponse list(@RequestBody ClassGroupReq classGroupReq) {
        return studentAttendanceService.getPage(classGroupReq);
    }

    @PostMapping("/listByCourse")
    @ApiOperation("点名详情-考勤列表")
    public PageResponse listByCourse(@RequestBody CourseScheduleReq courseScheduleReq) {
        return studentAttendanceService.getPageByCourse(courseScheduleReq);
    }

    @PostMapping("/statisticsList")
    @ApiOperation("历史考勤统计-考勤列表")
    public PageResponse statisticsList(@RequestBody ClassGroupReq classGroupReq) {
        return studentAttendanceService.statisticsList(classGroupReq);
    }

}
