package com.yonge.cooleshow.teacher.controller;

import com.yonge.cooleshow.biz.dal.entity.MusicSheetAuthRecord;
import com.yonge.cooleshow.biz.dal.service.MusicSheetAuthRecordService;
import com.yonge.cooleshow.common.controller.BaseController;
import com.yonge.cooleshow.common.entity.HttpResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("${app-config.url.teacher:}/musicSheetAuthRecord")
@Api(tags = "曲谱审核表 API接口")
public class MusicSheetAuthRecordController extends BaseController {
    @Resource
    private MusicSheetAuthRecordService musicSheetAuthRecordService;

    @ApiOperation(value = "新增", notes = " 传入 MusicSheetAuthRecord")
    @PostMapping("/save")
    public HttpResponseResult<Integer> cbsAdd(@RequestBody MusicSheetAuthRecord musicSheetAuthRecord) {
        return succeed(musicSheetAuthRecordService.addRecord(musicSheetAuthRecord));
    }

    @ApiOperation(value = "修改", notes = " 传入 MusicSheetAuthRecord")
    @PostMapping("/update")
    public HttpResponseResult update(@Validated @RequestBody MusicSheetAuthRecord musicSheetAuthRecord) {
        musicSheetAuthRecordService.updateRecord(musicSheetAuthRecord);
        return succeed();
    }
}
