|
|
|
@ -10,6 +10,7 @@ import com.sztzjy.money_management.entity.dto.TopicDto;
|
|
|
|
|
import com.sztzjy.money_management.mapper.ObjectiveQuestionMapper;
|
|
|
|
|
import com.sztzjy.money_management.service.ObjectiveQuestionService;
|
|
|
|
|
import com.sztzjy.money_management.util.ResultEntity;
|
|
|
|
|
import com.sztzjy.money_management.util.file.IFileUtil;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
|
@ -19,6 +20,7 @@ import org.springframework.http.HttpStatus;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
@ -35,7 +37,8 @@ public class TopicController {
|
|
|
|
|
private ObjectiveQuestionMapper objectiveQuestionMapper;
|
|
|
|
|
@Autowired
|
|
|
|
|
private ObjectiveQuestionService objectiveQuestionService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IFileUtil fileUtil;
|
|
|
|
|
|
|
|
|
|
@PostMapping("/insertSingleTopic")
|
|
|
|
|
@ApiOperation("新增单个客观题")
|
|
|
|
@ -191,7 +194,7 @@ public class TopicController {
|
|
|
|
|
return new ResultEntity<List<ObjectiveQuestionDto>>(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @PostMapping("/getObjectiveByRandom")
|
|
|
|
|
// @PostMapping("/getObjectiveByRandom")
|
|
|
|
|
// @ApiOperation("考试/返回指定类型和数量的随机客观题")
|
|
|
|
|
// @AnonymousAccess
|
|
|
|
|
// private ResultEntity<List<ObjectiveQuestionWithBLOBs>> getObjectiveByRandom(@ApiParam("题目类型 0单选,1多选,2判断)") @RequestParam int type,
|
|
|
|
@ -200,5 +203,12 @@ public class TopicController {
|
|
|
|
|
// List<ObjectiveQuestionWithBLOBs> list = objectiveQuestionMapper.getObjectiveByRandom(type, count, schoolId);
|
|
|
|
|
// return new ResultEntity<>(list);
|
|
|
|
|
// }
|
|
|
|
|
//客观题导入模板下载
|
|
|
|
|
@GetMapping("downloadResource")
|
|
|
|
|
@ApiOperation("客观题导入模板下载")
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
public void downloadResource(HttpServletResponse response) {
|
|
|
|
|
fileUtil.download(response, "客观题导入模板.xlsx", "/客观题导入模板.xlsx");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|