package com.ym.mec.student.controller;

import com.ym.mec.biz.dal.enums.ClientTypeEnum;
import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
import com.ym.mec.biz.service.SysMusicScoreAccompanimentService;
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.web.bind.annotation.*;

@RequestMapping("sysMusicScoreAccompaniment")
@Api(tags = "曲库服务")
@RestController
public class SysMusicScoreAccompanimentController extends BaseController {

    @Autowired
    private SysMusicScoreAccompanimentService sysMusicScoreAccompanimentService;

    @ApiOperation(value = "分页查询")
    @GetMapping("/queryPage")
    public Object queryPage(SysExamSongQueryInfo queryInfo) {
        queryInfo.setType("COMMON");
        if(queryInfo.getClientType() == null){
            queryInfo.setClientType(ClientTypeEnum.NETWORK_ROOM);
        }
        return succeed(sysMusicScoreAccompanimentService.queryAccPage(queryInfo));
    }

    @ApiOperation(value = "分页查询")
    @GetMapping("/queryPageLimit")
    public Object queryPageLimit(SysExamSongQueryInfo queryInfo) {
        queryInfo.setType("COMMON");
        if(queryInfo.getClientType() == null){
            queryInfo.setClientType(ClientTypeEnum.NETWORK_ROOM);
        }
        return succeed(sysMusicScoreAccompanimentService.queryScorePage(queryInfo));
    }

    @ApiOperation(value = "获取伴奏声部列表")
    @GetMapping("/querySubjectIds")
    public Object querySubjectIds() {
        return succeed(sysMusicScoreAccompanimentService.querySubjectIds());
    }
}
