From f84f7047c43d86c4b78df142d81a00d6786c0d62 Mon Sep 17 00:00:00 2001 From: wangqing <408564126@qq.com> Date: Tue, 30 Jan 2024 20:01:28 +0800 Subject: [PATCH] add api operations for comment --- .../java/com/luoo/comment/controller/CommentController.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/luoo_comment/src/main/java/com/luoo/comment/controller/CommentController.java b/luoo_comment/src/main/java/com/luoo/comment/controller/CommentController.java index 6785779..77ec602 100644 --- a/luoo_comment/src/main/java/com/luoo/comment/controller/CommentController.java +++ b/luoo_comment/src/main/java/com/luoo/comment/controller/CommentController.java @@ -11,6 +11,8 @@ import controller.BaseController; import dto.UserLoginDto; import dto.UserMessageDto; import enums.MessageTypeEnum; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -24,6 +26,7 @@ import java.util.concurrent.TimeUnit; @RestController @CrossOrigin @RequestMapping("/comment") +@Api(tags = "CommentController") public class CommentController extends BaseController { @@ -55,6 +58,7 @@ public class CommentController extends BaseController { * @return */ @GetMapping("/{journalId}/{page}/{size}") + @ApiOperation(value = "根据期刊ID获取分布评论列表",notes = "根据期刊ID获取根节点评论分页列表 ,数据库中保存的有期刊号的都是根节点,期刊号为空的代表有父评论且parentID一定有值,拿到当然根节点评论列表,每个根评论有 commentCount字段,页面可以显示有 280个回复,然后根据 @GetMapping(\"/comment/{parentId}/{page}/{size}\") 接口,分页拿到该评论下的子评论列表,页面在请求添加评论的时候,当给评论添加子评论的时候,父评论parentID有值,就无法添加子评论并且不显示回复2字,控制到两级") public Result findAllByJournalId(@PathVariable String journalId,@PathVariable int page,@PathVariable int size) { Page pageData = commentService.findByJournalId(journalId,page,size);