package com.rongwei.training.controller;

import com.rongwei.rwcommon.base.R;
import com.rongwei.training.vo.TrainingPaperVo;
import com.rongwei.trainingcommon.sys.service.TrainingExamPaperService;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * TrainingExamPaperController class
 *
 * @author XH
 * @date 2020/12/02
 */
@RestController
@RequestMapping("paper")
@Slf4j
public class TrainingExamPaperController {
    private final Logger logger = LoggerFactory.getLogger(this.getClass());
    @Autowired
    private TrainingExamPaperService trainingExamPaperService;

    @PostMapping("/question/check")
    public R questionCheck(@RequestBody TrainingPaperVo vo) {
        logger.info("开始更新试卷信息表: {}", vo);
        return trainingExamPaperService.questionCheck(vo);
    }

    @PostMapping("/saveorupdate")
    public R saveorupdate(@RequestBody TrainingPaperVo vo) {
        logger.info("开始更新试卷信息表: {}", vo);
        return trainingExamPaperService.saveorupdate(vo);
    }
}
