From 7b3e3df4b74e5788ef1fdfb5558de3680f2470a2 Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Tue, 27 Feb 2024 16:08:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=80=81=E5=B8=88=E7=AB=AF?= =?UTF-8?q?=E9=A5=BC=E7=8A=B6=E5=9B=BE=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/tea/TeaTopicManageController.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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