package com.miaxis.app.controller.coach;

import com.miaxis.app.coach.domain.CoachEvaluateLabel;
import com.miaxis.app.coach.dto.CoachEvaluateDto;
import com.miaxis.app.coach.service.ICoachEvaluateService;
import com.miaxis.common.annotation.Log;
import com.miaxis.common.constant.Constants;
import com.miaxis.common.core.controller.BaseController;
import com.miaxis.common.core.domain.Response;
import com.miaxis.common.enums.BusinessTypeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * 【教练评价】Controller
 *
 * @author wwl
 * @date 2020-12-28
 */
@RestController
@RequestMapping(Constants.STUDENT_PREFIX+"/system/evaluate")
@Api(tags={"【app-教练评价】"})
public class CoachEvaluateController extends BaseController{

    @Autowired
    private ICoachEvaluateService coachEvaluateService;



    /**
     * 查询教练评价标签列表
     */
    @GetMapping("/selectCoachEvaluateLabelList")
    @ApiOperation("查询教练评价标签列表")
    public Response<List<CoachEvaluateLabel>> selectCoachEvaluateLabelList(){
        List<CoachEvaluateLabel> list = coachEvaluateService.selectCoachEvaluateLabelList();
        return Response.success(list);
    }


    /**
     * 新增教练评价
     */
    @PostMapping("/addCoachEvaluate")
    @ApiOperation("新增教练评价")
    public Response addCoachEvaluate(CoachEvaluateDto coachEvaluateDto){
        try {
            return coachEvaluateService.addCoachEvaluate(coachEvaluateDto);
        }catch (Exception e){
            return Response.error();
        }
    }


}
