package com.ym.mec.student.controller;

import com.ym.mec.biz.dal.page.StudentDemoGroupQueryInfo;
import com.ym.mec.biz.service.DemoGroupService;
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.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author Joburgess
 * @Date 2019/9/25
 */
@Api(tags = "试听课-学生端")
@RequestMapping("studentDemoGroup")
@RestController
public class StudentDemoGroupController extends BaseController {

    @Autowired
    private DemoGroupService demoGroupService;

    @ApiOperation(value = "试听课列表获取")
    @PostMapping("/queryStudentDemoGroups")
    public Object queryStudentDemoGroups(StudentDemoGroupQueryInfo queryInfo){
        return succeed(demoGroupService.queryStudentDemoGroups(queryInfo));
    }

    @ApiOperation(value = "试听课列表获取")
    @PostMapping("/demoGroupSubscribe")
    public Object demoGroupSubscribe(Long demoGroupId){
        demoGroupService.demoGroupSubscribe(demoGroupId);
        return succeed();
    }
}
