diff --git a/src/main/java/com/sztzjy/fund_investment/controller/tea/TeaTopicManageController.java b/src/main/java/com/sztzjy/fund_investment/controller/tea/TeaTopicManageController.java index 3f7cd6a..da1c8e3 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/tea/TeaTopicManageController.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/tea/TeaTopicManageController.java @@ -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 getQuestionById(@ApiParam("展示接口中的id字段") @RequestParam String questionId) { - return new ResultEntity(questionAnswerMapper.selectByPrimaryKey(questionId)); +// QuestionAnswerWithBLOBs questionAnswerWithBLOBs = questionAnswerMapper.selectByPrimaryKey(questionId); + QuestionAnswerExample answerExample = new QuestionAnswerExample(); + answerExample.createCriteria().andIdEqualTo(questionId); + List questionAnswerWithBLOBs = questionAnswerMapper.selectByExampleWithBLOBs(answerExample); + if (!questionAnswerWithBLOBs.isEmpty()){ + QuestionAnswerWithBLOBs questionAnswerWithBLOBs1 = questionAnswerWithBLOBs.get(0); + return new ResultEntity<>(questionAnswerWithBLOBs1); + } + return new ResultEntity<>(new QuestionAnswerWithBLOBs()); } @AnonymousAccess