package com.ym.mec.web.controller;

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

import java.math.BigDecimal;

@RequestMapping("musicGroupStudentFee")
@Api(tags = "乐团学生费用")
@RestController
public class MusicGroupStudentFeeController extends BaseController {

    @Autowired
    private MusicGroupStudentFeeService musicGroupStudentFeeService;

    @ApiOperation(value = "列表查询")
    @GetMapping("/queryPage")
    @PreAuthorize("@pcs.hasPermissions('musicGroupStudentFee/queryPage')")
    public Object queryPage(MusicCalenderDetailQueryInfo queryInfo) {
        return succeed(musicGroupStudentFeeService.queryPage(queryInfo));
    }

    @ApiOperation(value = "批量修改课程费用")
    @PostMapping("/batchUpdateCourseFee")
    @PreAuthorize("@pcs.hasPermissions('musicGroupStudentFee/batchUpdateCourseFee')")
    public Object batchUpdateCourseFee(String ids, BigDecimal courseFee) {
        musicGroupStudentFeeService.batchUpdateCourseFee(ids,courseFee);
        return succeed();
    }

}
