package cn.com.qmth.examcloud.core.questions.api.controller;

import cn.com.qmth.examcloud.core.questions.dao.entity.ExamFile;
import cn.com.qmth.examcloud.core.questions.service.ExamFileService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author chenken
 * @date 2017年7月25日 下午2:21:57
 * @company QMTH
 * @description ExamFileController.java
 */
@Controller
@RequestMapping("${api_cqb}/")
public class ExamFileController {

    @Autowired
    private ExamFileService examFileService;

    @ApiOperation(value = "查询试卷文件", notes = "查询试卷文件")
    @PostMapping(value = "/findExamFile")
    public ResponseEntity<Object> findExamFile(@RequestBody ExamFile examFile) {
        List<ExamFile> examFiles = examFileService.findExamFileListByExamFile(examFile);
        return new ResponseEntity<>(examFiles, HttpStatus.OK);
    }
}

