package com.ym.mec.student.controller;

import com.ym.mec.biz.dal.dto.ClassDateAdjustDto;
import com.ym.mec.biz.service.CourseScheduleService;
import com.ym.mec.biz.service.StudentAttendanceService;
import com.ym.mec.common.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

/**
 * @Author Joburgess
 * @Date 2019/9/24
 */
@RequestMapping("studentCourseSchedule")
@Api(tags = "课程计划服务")
@RestController
public class StudentCourseScheduleController extends BaseController {

    @Autowired
    private CourseScheduleService scheduleService;
    @Autowired
    private StudentAttendanceService studentAttendanceService;

    @ApiOperation(value = "课时调整")
    @PostMapping(value = "/classStartDateAdjust",consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public Object classStartDateAdjust(ClassDateAdjustDto classDateAdjustDto){
        scheduleService.classStartDateAdjust(classDateAdjustDto);
        return succeed();
    }

    @ApiOperation(value = "课时交换")
    @GetMapping(value = "/courseSwap",consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public Object courseSwap(Long courseScheduleId1,Long courseScheduleId2){
        scheduleService.courseSwap(courseScheduleId1,courseScheduleId2);
        return succeed();
    }

}
