package com.ym.mec.student.controller;

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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ym.mec.auth.api.client.SysUserFeignService;
import com.ym.mec.auth.api.entity.SysUser;
import com.ym.mec.biz.dal.dao.EmployeeDao;
import com.ym.mec.biz.dal.page.StudentAttendanceQueryInfo;
import com.ym.mec.biz.service.ClassGroupService;
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;
    @Autowired
    private ClassGroupService classGroupService;
    @Autowired
    private SysUserFeignService sysUserFeignService;
    @Autowired
    private EmployeeDao employeeDao;


    @ApiOperation(value = "获取某节课学生签到列表")
    @GetMapping("/findStudentAttendance")
    public Object findStudentAttendance(StudentAttendanceQueryInfo queryInfo){
    	SysUser sysUser = sysUserFeignService.queryUserInfo();
        if (sysUser == null) {
            return failed("用户信息获取失败");
        }
        queryInfo.setStudentID(sysUser.getId());
        return succeed(studentAttendanceService.findStudentAttendance(queryInfo));
    }

}
