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.SysMusicScoreService;
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("sysMusicScore")
@Api(tags = "曲库")
@RestController
public class SysMusicScoreController extends BaseController {

    @Autowired
    private SysMusicScoreService sysMusicScoreService;

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

    @ApiOperation(value = "分页查询")
    @GetMapping("/queryPage2")
    public Object queryPage2(SysExamSongQueryInfo queryInfo) {
        queryInfo.setType("COMMON");
        queryInfo.setShowFlag(1);
        queryInfo.setClientType(ClientTypeEnum.SMART_PRACTICE);
        return succeed(sysMusicScoreService.queryMusicScorePageInfo(queryInfo));
    }
}
