@@ -38,7 +38,7 @@ public class InspectQuestionController extends ApiBaseController { | |||
*/ | |||
@PostMapping("/getQuestionList") | |||
public Response getQuestionList(@RequestBody InspectQuestionQuery inspectQuestionDto) { | |||
return response.success(inspectQuestionService.getQuestionList(inspectQuestionDto)); | |||
return inspectQuestionService.getQuestionList(inspectQuestionDto); | |||
} | |||
/** |
@@ -29,7 +29,7 @@ public interface InspectQuestionMapper extends BaseMapper<TauvInspectQuestion> { | |||
* @param param 参数 | |||
* @return | |||
*/ | |||
List<InspectQuestionListVo> getQuestionList(IPage<TauvInspectQuestion> page, @RequestParam("param") InspectQuestionQuery param); | |||
IPage<InspectQuestionListVo> getQuestionList(IPage<TauvInspectQuestion> page, @RequestParam("param") InspectQuestionQuery param); | |||
/** | |||
* 获取问题详情 |
@@ -28,7 +28,7 @@ public interface IInspectQuestionService extends IService<TauvInspectQuestion> { | |||
* @param inspectQuestionDto 参数 | |||
* @return | |||
*/ | |||
List<InspectQuestionListVo> getQuestionList(InspectQuestionQuery inspectQuestionDto); | |||
Response getQuestionList(InspectQuestionQuery inspectQuestionDto); | |||
/** | |||
* 获取问题详情 |
@@ -75,9 +75,20 @@ public class InspectQuestionServiceImpl extends ServiceImpl<InspectQuestionMappe | |||
* @return | |||
*/ | |||
@Override | |||
public List<InspectQuestionListVo> getQuestionList(InspectQuestionQuery inspectQuestionDto) { | |||
public Response getQuestionList(InspectQuestionQuery inspectQuestionDto) { | |||
IPage<TauvInspectQuestion> page = new Page<>(inspectQuestionDto.getPage(), inspectQuestionDto.getPageSize()); | |||
return inspectQuestionMapper.getQuestionList(page, inspectQuestionDto); | |||
// 获取分页数据 | |||
IPage<InspectQuestionListVo> data = inspectQuestionMapper.getQuestionList(page, inspectQuestionDto); | |||
// 返回结果 | |||
Map<String, Object> result = new HashMap<>(); | |||
result.put("total", data.getTotal()); | |||
result.put("size", data.getSize()); | |||
result.put("current", data.getCurrent()); | |||
result.put("pages", data.getPages()); | |||
result.put("records", data.getRecords()); | |||
return response.success(result); | |||
} | |||
/** |