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

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

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.dto.TeacherSignOutDto;
import com.ym.mec.biz.dal.page.TeacherAttendanceQueryInfo;
import com.ym.mec.biz.service.TeacherAttendanceService;
import com.ym.mec.common.controller.BaseController;

@RequestMapping("teacherAttendance")
@Api(tags = "教师签到服务")
@RestController
public class TeacherAttendanceController extends BaseController {

    @Autowired
    private TeacherAttendanceService teacherAttendanceService;

    @ApiOperation(value = "新增教师签到")
    @PostMapping("/add")
    public Object add(@RequestBody TeacherSignOutDto teacherSignOutDto) {
        teacherAttendanceService.addTeacherAttendanceRecord(teacherSignOutDto);
        return succeed();
    }

    @ApiOperation(value = "分页查询教师签到列表")
    @GetMapping("/queryPage")
    public Object queryPage(TeacherAttendanceQueryInfo queryInfo) {
        return succeed(teacherAttendanceService.queryPage(queryInfo));
    }

    @ApiOperation(value = "查询教师签到记录")
    @GetMapping("/getTeacherPersonalAttendances")
    public Object getTeacherPersonalAttendances(TeacherAttendanceQueryInfo queryInfo){
        return teacherAttendanceService.getTeacherPersonalAttendances(queryInfo);
    }

}
