package com.miaxis.app.controller.exam;

import com.miaxis.common.constant.Constants;
import com.miaxis.common.core.controller.BaseController;
import com.miaxis.common.core.domain.Response;
import com.miaxis.common.core.page.ResponsePageInfo;
import com.miaxis.examvip.domain.VipExamVideo;
import com.miaxis.examvip.service.IVipExamVideoService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 【考场视频】Controller
 *
 * @author miaxis
 * @date 2023-03-20
 */
@RestController
@RequestMapping(Constants.OPEN_PREFIX+"/vip/video")
@Api(tags={"【APP-考场视频】"})
public class VipExamVideoController extends BaseController {
    @Autowired
    private IVipExamVideoService vipExamVideoService;

    /**
     * 查询考场视频列表
     */
    @GetMapping("/list")
    @ApiOperation("查询考场视频列表")
        @ApiImplicitParams({
            @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
            @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
    })
    public ResponsePageInfo<VipExamVideo> list(@ModelAttribute VipExamVideo vipExamVideo){
        startPage();
        List<VipExamVideo> list = vipExamVideoService.selectVipExamVideoList(vipExamVideo);
        return toResponsePageInfo(list);
    }
    


    /**
     * 获取考场视频详细信息
     */
    @GetMapping(value = "/{id}")
    @ApiOperation("获取考场视频详细信息")
    public Response<VipExamVideo> getInfo(
            @ApiParam(name = "id", value = "考场视频参数", required = true)
            @PathVariable("id") Long id
    ){
        return Response.success(vipExamVideoService.getById(id));
    }



}
