From 86b6fcd12634fbb08a2bd8a2cf44205f7e1d2067 Mon Sep 17 00:00:00 2001
From: zengh <123456>
Date: Sat, 09 Oct 2021 10:34:14 +0800
Subject: [PATCH] 点赞评论相关提交
---
src/main/java/org/springblade/modules/comment/controller/CommentController.java | 23 ++++++++++++++++++++++-
1 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/src/main/java/org/springblade/modules/comment/controller/CommentController.java b/src/main/java/org/springblade/modules/comment/controller/CommentController.java
index d3c5859..f5101cf 100644
--- a/src/main/java/org/springblade/modules/comment/controller/CommentController.java
+++ b/src/main/java/org/springblade/modules/comment/controller/CommentController.java
@@ -34,6 +34,7 @@
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
+import java.util.Date;
/**
* 控制器
@@ -84,6 +85,17 @@
}
/**
+ * 自定义分页
+ */
+ @GetMapping("/articlepage")
+ @ApiOperationSupport(order = 3)
+ @ApiOperation(value = "分页", notes = "传入survey")
+ public R<IPage<CommentVO>> articlepage(CommentVO comment, Query query) {
+ IPage<CommentVO> pages = commentService.articlepage(Condition.getPage(query), comment);
+ return R.data(pages);
+ }
+
+ /**
* 新增
*/
@PostMapping("/save")
@@ -109,7 +121,16 @@
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入survey")
- public R submit(@Valid Comment comment) {
+ public R submit(@Valid @RequestBody Comment comment) {
+ if (null==comment.getTime()){
+ comment.setTime(new Date());
+ }
+ if (comment.getTopping()== null || comment.getIsexamine().equals("")){
+ comment.setTopping("0");
+ }
+ if (comment.getIsexamine() == null || comment.getIsexamine().equals("")){
+ comment.setIsexamine("0");
+ }
return R.status(commentService.saveOrUpdate(comment));
}
--
Gitblit v1.9.3