修复增加文章浏览量

This commit is contained in:
TinyAnts 2022-09-16 16:20:32 +08:00
parent 97b3da1f37
commit 898daf418c
2 changed files with 4 additions and 1 deletions

View File

@ -77,7 +77,6 @@ public class ArticleController {
@GetMapping("/collect")
public Object collect(@Validated PageParam pageParam) {
Integer userId = LikeFrontThreadLocal.getUserId();
System.out.println(userId);
PageResult<ArticleCollectVo> list = iArticleService.collect(pageParam, userId);
return AjaxResult.success(list);
}

View File

@ -160,6 +160,10 @@ public class ArticleServiceImpl implements IArticleService {
vo.setCollect(articleCollect != null);
vo.setImage(UrlUtil.toAbsoluteUrl(article.getImage()));
vo.setCreateTime(TimeUtil.timestampToDate(article.getCreateTime()));
article.setVisit(article.getVisit() + 1);
articleMapper.updateById(article);
return vo;
}