|
|
@@ -539,4 +539,20 @@ public class ForumPostInfoServiceImpl extends ServiceImpl<ForumPostInfoMapper, F
|
|
|
return page;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public CommonResult<com.alibaba.fastjson.JSONObject> getCount() {
|
|
|
+ // 查询帖子未关闭的总数量
|
|
|
+ QueryWrapper<ForumPostInfo> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.lambda().eq(ForumPostInfo::getPostStatus, 0);
|
|
|
+ long count = this.count(queryWrapper);
|
|
|
+ // 查询所有回复数量
|
|
|
+ QueryWrapper<ForumPostReply> queryWrapper1 = new QueryWrapper<>();
|
|
|
+ long replyCount = forumPostReplyService.count(queryWrapper1);
|
|
|
+ // 封装返回参数
|
|
|
+ com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
|
|
|
+ jsonObject.put("postCount", count);
|
|
|
+ jsonObject.put("replyCount", replyCount);
|
|
|
+ return CommonResult.data(jsonObject);
|
|
|
+ }
|
|
|
+
|
|
|
}
|