Commit 8783a47c by 胡学良

修改问题详情

parent 35986ecc
......@@ -311,8 +311,13 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
//5.获取话题详情
List<TopicReference> references = topicReferenceService.list(QuestionUtils.getWrapper("referencer_id", question.getQuestionId()));
List<String> topicIds = references.stream().map(TopicReference::getTopicId).collect(Collectors.toList());
List<Topic> topics = topicService.listByIds(topicIds);
List<Topic> topics = new ArrayList<>();
if (!CollectionUtils.isEmpty(topicIds)) {
topics = topicService.listByIds(topicIds);
}
if (CollectionUtils.isEmpty(topics)) {
question.setTopics(List.of());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment