zhongrj
2024-01-06 ad0bc4e763fa988a2ec4dd8dfab7381ea7726021
src/main/java/org/springblade/modules/article/controller/ArticleController.java
@@ -15,6 +15,7 @@
import org.springblade.modules.article.service.ArticleService;
import org.springblade.modules.article.vo.ArticleVO;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.Date;
@@ -107,8 +108,17 @@
   @GetMapping("/detail")
   @ApiOperationSupport(order = 1)
   @ApiOperation(value = "详情", notes = "传入articleoy")
   public R<Article> detail(Article article) {
      Article detail = articleService.getOne(Condition.getQueryWrapper(article));
   public R<Article> detail(ArticleVO article) {
      ArticleVO detail = articleService.getArticleOne(article);
      UpdateWrapper<Article> objectUpdateWrapper = new UpdateWrapper<>();
      objectUpdateWrapper.setSql("view_number = view_number + 1");
      objectUpdateWrapper.eq("id", article.getId());
      articleService.update(null, objectUpdateWrapper);
//      List<List<String>> lists = new ArrayList<>();
//      if (StringUtils.isNotBlank(detail.getArticleRange())) {
//         lists = (List<List<String>>) JSON.parse(detail.getArticleRange());
//      }
//      detail.setArticleList(lists);
      return R.data(detail);
   }