|
|
|
@ -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<Comment> pageData = commentService.findByJournalId(journalId,page,size);
|
|
|
|
|