package com.keao.edu.controller;

import com.keao.edu.common.controller.BaseController;
import com.keao.edu.common.entity.HttpResponseResult;
import com.keao.edu.user.service.ExamRoomStudentRelationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("examRoomStudentRelation")
@Api(tags = "考场与学生关联服务")
public class ExamRoomStudentRelationController extends BaseController {

    @Autowired
    private ExamRoomStudentRelationService examRoomStudentRelationService;

    @ApiOperation("下一位")
    @PostMapping(value = "/nextBit")
    public HttpResponseResult nextBit(Integer examStatus,Long roomId) {
        examRoomStudentRelationService.nextBit(examStatus,roomId);
        return succeed();
    }

    @ApiOperation("开始考试")
    @PostMapping(value = "/actionExam")
    public HttpResponseResult actionExam(Long roomId) {
        examRoomStudentRelationService.actionExam(roomId);
        return succeed();
    }

    @ApiOperation("监考端选择去录播")
    @PostMapping(value = "/webRecorded")
    public HttpResponseResult webRecorded(Long roomId) {
        examRoomStudentRelationService.recorded(roomId);
        return succeed();
    }

    @ApiOperation("获取后台考场待考队列")
    @PostMapping(value = "/queryNeedCheckingList")
    public HttpResponseResult queryNeedCheckingList(Long roomId) {
        return succeed(examRoomStudentRelationService.queryNeedCheckingList(roomId));
    }
}
