package com.ym.mec.web.controller.student;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
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;

import com.ym.mec.biz.dal.entity.StudentAttendance;
import com.ym.mec.biz.dal.page.StudentAttendanceQueryInfo;
import com.ym.mec.biz.service.StudentAttendanceService;
import com.ym.mec.common.controller.BaseController;

@RequestMapping("studentAttendance")
@Api(tags = "学生考勤服务")
@RestController
public class StudentAttendanceController extends BaseController {

    @Autowired
    private StudentAttendanceService studentAttendanceService;

    @ApiOperation(value = "批量插入学生上课签到信息")
    @PostMapping("/addStudentAttendances")
    public Object addStudentAttendances(@RequestBody List<StudentAttendance> studentAttendances){
        studentAttendanceService.addStudentAttendances(studentAttendances);
        return succeed();
    }

    @ApiOperation(value = "获取学生个人签到信息")
    @GetMapping("/queryStudentPersonalAttendances")
    public Object queryStudentPersonalAttendances(@RequestBody StudentAttendanceQueryInfo queryInfo){
        return succeed(studentAttendanceService.getStudentPersonalAttendances(queryInfo));
    }

}
