|
@@ -7,10 +7,10 @@ import com.miaxis.common.core.page.ResponsePageInfo;
|
|
|
import com.miaxis.common.enums.BusinessTypeEnum;
|
|
|
import com.miaxis.common.utils.poi.ExcelUtil;
|
|
|
import com.miaxis.question.domain.QuestionInfo;
|
|
|
+import com.miaxis.question.dto.QuestionInfoDto;
|
|
|
import com.miaxis.question.service.IQuestionInfoService;
|
|
|
import io.swagger.annotations.*;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.Arrays;
|
|
@@ -45,65 +45,78 @@ public class QuestionInfoController extends BaseController{
|
|
|
return toResponsePageInfo(list);
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/getQuestionInfoList")
|
|
|
+ @ApiOperation("查询题库列表")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
|
|
|
+ @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
|
|
|
+ })
|
|
|
+ public ResponsePageInfo<QuestionInfo> getQuestionInfoList(@ModelAttribute QuestionInfoDto questionInfoDto){
|
|
|
+ startPage();
|
|
|
+ List<QuestionInfo> list = questionInfoService.getQuestionInfoList(questionInfoDto);
|
|
|
+ return toResponsePageInfo(list);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 导出题库列表
|
|
|
*/
|
|
|
// @PreAuthorize("@ss.hasPermi('question:info:export')")
|
|
|
- @Log(title = "题库", businessType = BusinessTypeEnum.EXPORT)
|
|
|
- @GetMapping("/export")
|
|
|
- @ApiOperation("导出题库列表Excel")
|
|
|
- public Response<String> export(@ModelAttribute QuestionInfo questionInfo){
|
|
|
- List<QuestionInfo> list = questionInfoService.selectQuestionInfoList(questionInfo);
|
|
|
- ExcelUtil<QuestionInfo> util = new ExcelUtil<QuestionInfo>(QuestionInfo.class);
|
|
|
- return util.exportExcel(list, "info");
|
|
|
- }
|
|
|
+// @Log(title = "题库", businessType = BusinessTypeEnum.EXPORT)
|
|
|
+// @GetMapping("/export")
|
|
|
+// @ApiOperation("导出题库列表Excel")
|
|
|
+// public Response<String> export(@ModelAttribute QuestionInfo questionInfo){
|
|
|
+// List<QuestionInfo> list = questionInfoService.selectQuestionInfoList(questionInfo);
|
|
|
+// ExcelUtil<QuestionInfo> util = new ExcelUtil<QuestionInfo>(QuestionInfo.class);
|
|
|
+// return util.exportExcel(list, "info");
|
|
|
+// }
|
|
|
|
|
|
/**
|
|
|
* 获取题库详细信息
|
|
|
*/
|
|
|
// @PreAuthorize("@ss.hasPermi('question:info:query')")
|
|
|
- @GetMapping(value = "/{id}")
|
|
|
- @ApiOperation("获取题库详细信息")
|
|
|
- public Response<QuestionInfo> getInfo(
|
|
|
- @ApiParam(name = "id", value = "题库参数", required = true)
|
|
|
- @PathVariable("id") Long id
|
|
|
- ){
|
|
|
- return Response.success(questionInfoService.getById(id));
|
|
|
- }
|
|
|
+// @GetMapping(value = "/{id}")
|
|
|
+// @ApiOperation("获取题库详细信息")
|
|
|
+// public Response<QuestionInfo> getInfo(
|
|
|
+// @ApiParam(name = "id", value = "题库参数", required = true)
|
|
|
+// @PathVariable("id") Long id
|
|
|
+// ){
|
|
|
+// return Response.success(questionInfoService.getById(id));
|
|
|
+// }
|
|
|
|
|
|
/**
|
|
|
* 新增题库
|
|
|
*/
|
|
|
// @PreAuthorize("@ss.hasPermi('question:info:add')")
|
|
|
- @Log(title = "题库", businessType = BusinessTypeEnum.INSERT)
|
|
|
- @PostMapping
|
|
|
- @ApiOperation("新增题库")
|
|
|
- public Response<Integer> add(@RequestBody QuestionInfo questionInfo){
|
|
|
- return toResponse(questionInfoService.save(questionInfo) ? 1 : 0);
|
|
|
- }
|
|
|
+// @Log(title = "题库", businessType = BusinessTypeEnum.INSERT)
|
|
|
+// @PostMapping
|
|
|
+// @ApiOperation("新增题库")
|
|
|
+// public Response<Integer> add(@RequestBody QuestionInfo questionInfo){
|
|
|
+// return toResponse(questionInfoService.save(questionInfo) ? 1 : 0);
|
|
|
+// }
|
|
|
|
|
|
/**
|
|
|
* 修改题库
|
|
|
*/
|
|
|
// @PreAuthorize("@ss.hasPermi('question:info:edit')")
|
|
|
- @Log(title = "题库", businessType = BusinessTypeEnum.UPDATE)
|
|
|
- @PutMapping
|
|
|
- @ApiOperation("修改题库")
|
|
|
- public Response<Integer> edit(@RequestBody QuestionInfo questionInfo){
|
|
|
- return toResponse(questionInfoService.updateById(questionInfo) ? 1 : 0);
|
|
|
- }
|
|
|
+// @Log(title = "题库", businessType = BusinessTypeEnum.UPDATE)
|
|
|
+// @PutMapping
|
|
|
+// @ApiOperation("修改题库")
|
|
|
+// public Response<Integer> edit(@RequestBody QuestionInfo questionInfo){
|
|
|
+// return toResponse(questionInfoService.updateById(questionInfo) ? 1 : 0);
|
|
|
+// }
|
|
|
|
|
|
/**
|
|
|
* 删除题库
|
|
|
*/
|
|
|
// @PreAuthorize("@ss.hasPermi('question:info:remove')")
|
|
|
- @Log(title = "题库", businessType = BusinessTypeEnum.DELETE)
|
|
|
- @DeleteMapping("/{ids}")
|
|
|
- @ApiOperation("删除题库")
|
|
|
- public Response<Integer> remove(
|
|
|
- @ApiParam(name = "ids", value = "题库ids参数", required = true)
|
|
|
- @PathVariable Long[] ids
|
|
|
- ){
|
|
|
- return toResponse(questionInfoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
|
|
|
- }
|
|
|
+// @Log(title = "题库", businessType = BusinessTypeEnum.DELETE)
|
|
|
+// @DeleteMapping("/{ids}")
|
|
|
+// @ApiOperation("删除题库")
|
|
|
+// public Response<Integer> remove(
|
|
|
+// @ApiParam(name = "ids", value = "题库ids参数", required = true)
|
|
|
+// @PathVariable Long[] ids
|
|
|
+// ){
|
|
|
+// return toResponse(questionInfoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
|
|
|
+// }
|
|
|
}
|