package com.ym.mec.student.controller;

import com.ym.mec.biz.dal.entity.MusicEnlightenmentQuestionnaire;
import com.ym.mec.biz.service.MusicEnlightenmentQuestionnaireService;
import com.ym.mec.common.controller.BaseController;
import com.ym.mec.common.entity.HttpResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author Joburgess
 * @Date 2021/10/13 0013
 */
@Api(tags = "启蒙课问卷")
@RestController
@RequestMapping("musicEnlightenmentQuestionnaire")
public class MusicEnlightenmentQuestionnaireController extends BaseController {

    @Autowired
    private MusicEnlightenmentQuestionnaireService musicEnlightenmentQuestionnaireService;

    @ApiOperation(value = "添加启蒙课问卷")
    @PostMapping("addEnlightenmentQuestionnaire")
    public HttpResponseResult addEnlightenmentQuestionnaire(@RequestBody MusicEnlightenmentQuestionnaire enlightenmentQuestionnaire){
        musicEnlightenmentQuestionnaireService.addEnlightenmentQuestionnaire(enlightenmentQuestionnaire);
        return succeed();
    }

    @ApiOperation(value = "获取指定用户的乐团启蒙问卷记录")
    @GetMapping("getUserMusicEnlightenmentQuestionnaire")
    public HttpResponseResult<MusicEnlightenmentQuestionnaire> getUserMusicEnlightenmentQuestionnaire(String musicGroupId, String phone) {
        return succeed(musicEnlightenmentQuestionnaireService.getUserMusicEnlightenmentQuestionnaire(musicGroupId, phone));
    }

}
