package com.ym.mec.student.controller;

import com.ym.mec.biz.service.CourseScheduleEvaluateService;
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.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;

@RequestMapping("studyReport")
@Api(tags = "陪练报告")
@RestController
public class StudyReportController extends BaseController {

	@Autowired
	private CourseScheduleEvaluateService courseScheduleEvaluateService;


	@ApiOperation("获取学生陪练报告信息")
	@GetMapping(value = "info")
	public Object info(Integer classGroupId) {
		return succeed(courseScheduleEvaluateService.getStudyReport(classGroupId));
	}

	@ApiOperation(value = "课程组评论列表")
	@GetMapping("getGroupReviews")
	public Object getGroupReviews(Integer groupId) {
		return succeed(courseScheduleEvaluateService.findByGroupId(groupId,1));
	}

	@ApiOperation(value = "评论详情")
	@GetMapping("getReviewsInfo")
	public Object getReviewsInfo(Integer id) {
		return succeed(courseScheduleEvaluateService.findById(id));
	}
}
