package com.ym.mec.web.controller;

import com.ym.mec.biz.dal.dto.CourseScheduleStudentListDto;
import com.ym.mec.biz.dal.enums.StudentAttendanceStatusEnum;
import com.ym.mec.biz.dal.page.CourseHomeworkQueryInfo;
import com.ym.mec.biz.dal.page.CourseScheduleStudentPaymentQueryInfo;
import com.ym.mec.biz.service.StudentCourseHomeworkService;
import com.ym.mec.common.controller.BaseController;
import com.ym.mec.common.entity.HttpResponseResult;
import com.ym.mec.common.exception.BizException;
import com.ym.mec.common.page.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

/**
 * @Author Joburgess
 * @Date 2020/11/17 0017
 */
@RestController
@RequestMapping("studentCourseHomework")
@Api(tags = "学生课堂作业服务")
public class StudentCourseHomeworkController extends BaseController {

    @Autowired
    private StudentCourseHomeworkService studentCourseHomeworkService;

    @ApiOperation(value = "获取课程作业详情")
    @GetMapping("/getCourseHomeworkDetail")
    @PreAuthorize("@pcs.hasPermissions('studentCourseHomework/getCourseHomeworkDetail')")
    public HttpResponseResult getCourseHomeworkDetail(CourseHomeworkQueryInfo queryInfo) {
        if(Objects.isNull(queryInfo.getCourseScheduleId())){
            throw new BizException("请指定课程");
        }
        return succeed(studentCourseHomeworkService.getCourseHomeworkDetail(queryInfo));
    }

}
