洪城义警-正式版后台
zengh
2021-11-05 b39cc2beacc1ec2e37cff349cae42e420105c8a6
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));
   }