修改老师端饼状图接口返回格式

master
xiaoCJ 1 year ago
parent 338a9521b0
commit 7b3e3df4b7

@ -3,6 +3,7 @@ package com.sztzjy.fund_investment.controller.tea;
import cn.hutool.core.util.IdUtil;
import com.github.pagehelper.PageInfo;
import com.sztzjy.fund_investment.annotation.AnonymousAccess;
import com.sztzjy.fund_investment.entity.QuestionAnswerExample;
import com.sztzjy.fund_investment.entity.QuestionAnswerWithBLOBs;
import com.sztzjy.fund_investment.entity.TopicsWithBLOBs;
import com.sztzjy.fund_investment.entity.dto.QuestionAnswerDto;
@ -111,7 +112,15 @@ public class TeaTopicManageController {
@GetMapping("/getQuestionById")
@ApiOperation("互动答疑/获取单条互动数据")
public ResultEntity<QuestionAnswerWithBLOBs> getQuestionById(@ApiParam("展示接口中的id字段") @RequestParam String questionId) {
return new ResultEntity<QuestionAnswerWithBLOBs>(questionAnswerMapper.selectByPrimaryKey(questionId));
// QuestionAnswerWithBLOBs questionAnswerWithBLOBs = questionAnswerMapper.selectByPrimaryKey(questionId);
QuestionAnswerExample answerExample = new QuestionAnswerExample();
answerExample.createCriteria().andIdEqualTo(questionId);
List<QuestionAnswerWithBLOBs> questionAnswerWithBLOBs = questionAnswerMapper.selectByExampleWithBLOBs(answerExample);
if (!questionAnswerWithBLOBs.isEmpty()){
QuestionAnswerWithBLOBs questionAnswerWithBLOBs1 = questionAnswerWithBLOBs.get(0);
return new ResultEntity<>(questionAnswerWithBLOBs1);
}
return new ResultEntity<>(new QuestionAnswerWithBLOBs());
}
@AnonymousAccess

Loading…
Cancel
Save