linwe
2024-08-09 8b7258c9427882bb1798f1502eaa35184c6e374e
src/main/java/org/springblade/modules/article/controller/ArticleCommentController.java
@@ -7,10 +7,13 @@
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.apache.logging.log4j.util.Strings;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.AesUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.article.entity.ArticleCommentEntity;
import org.springblade.modules.article.service.IArticleCommentService;
@@ -57,10 +60,23 @@
   /**
    * 通知评论表 自定义分页
    */
   @GetMapping("/pageWeb")
   @ApiOperationSupport(order = 3)
   @ApiOperation(value = "分页", notes = "传入articleComment")
   public R<IPage<ArticleCommentVO>> pageWeb(ArticleCommentVO articleComment, Query query) {
      IPage<ArticleCommentVO> pages = articleCommentService.selectArticleCommentPage(Condition.getPage(query), articleComment);
      return R.data(pages);
   }
   /**
    * 通知评论表 自定义分页
    */
   @GetMapping("/page")
   @ApiOperationSupport(order = 3)
   @ApiOperation(value = "分页", notes = "传入articleComment")
   public R<IPage<ArticleCommentVO>> page(ArticleCommentVO articleComment, Query query) {
      articleComment.setUserId(AuthUtil.getUserId());
      articleComment.setCheckStatus(2);
      IPage<ArticleCommentVO> pages = articleCommentService.selectArticleCommentPage(Condition.getPage(query), articleComment);
      return R.data(pages);
   }
@@ -72,7 +88,12 @@
   @ApiOperationSupport(order = 4)
   @ApiOperation(value = "新增", notes = "传入articleComment")
   public R save(@Valid @RequestBody ArticleCommentEntity articleComment) {
      return R.status(articleCommentService.save(articleComment));
      articleComment.setUserId(AuthUtil.getUserId());
      String msg = articleCommentService.saveComment(articleComment);
      if (!Strings.isBlank(msg)&& msg.equals("操作成功")){
         return R.data(200,"",msg);
      }
      return R.data(201,"",msg);
   }
   /**
@@ -92,6 +113,7 @@
   @ApiOperationSupport(order = 6)
   @ApiOperation(value = "新增或修改", notes = "传入articleComment")
   public R submit(@Valid @RequestBody ArticleCommentEntity articleComment) {
      articleComment.setUserId(AuthUtil.getUserId());
      return R.status(articleCommentService.saveOrUpdate(articleComment));
   }