package com.ym.mec.teacher.controller;

import com.ym.mec.biz.dal.page.CourseScheduleQueryInfo;
import com.ym.mec.biz.service.ClassGroupService;
import com.ym.mec.common.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
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;

/**
 * @Author Joburgess
 * @Date 2019/10/17
 */
@Api(tags = "班级服务")
@RequestMapping("classGroup")
@RestController
public class ClassGroupController extends BaseController {

    @Autowired
    private ClassGroupService classGroupService;

    @ApiOperation(value = "教师关联班级获取")
    @GetMapping("/findTeacherClassGroups")
    public Object findTeacherClassGroups(@ApiParam(value = "课程类型：MUSIC_GROUP，VIP,PRACTICE", required = true)String type){
        return succeed(classGroupService.findTeacherClassGroups(type));
    }

    @ApiOperation(value = "获取教师班级详情界面头部信息")
    @GetMapping("/findTeacherClassGroupInfo")
    public Object findTeacherClassGroupInfo(@ApiParam(value = "班级编号", required = true)Long classGroupId){
        return succeed(classGroupService.findTeacherClassGroupInfo(classGroupId));
    }

    @ApiOperation(value = "获取班级对应学生列表")
    @GetMapping("/findTeacherClassStudents")
    public Object findTeacherClassStudents(CourseScheduleQueryInfo queryInfo){
        return succeed(classGroupService.findTeacherClassStudents(queryInfo));
    }

}
