|
@@ -803,6 +803,22 @@ public class CommunityArticleServiceImpl extends ServiceImpl<CommunityArticleMap
|
|
communityArticle.setUpdateTime(DateUtils.parseDate(DateUtils.getTime()));
|
|
communityArticle.setUpdateTime(DateUtils.parseDate(DateUtils.getTime()));
|
|
|
|
|
|
|
|
|
|
|
|
+ CommunityArticle article = communityArticleMapper.selectOne((new QueryWrapper<CommunityArticle>()
|
|
|
|
+ .eq("id", communityArticle.getId())
|
|
|
|
+ .and((wrapper) -> {
|
|
|
|
+ wrapper.ne("is_delete", true).or().isNull("is_delete");
|
|
|
|
+ })));
|
|
|
|
+
|
|
|
|
+ if (article != null) {
|
|
|
|
+ Integer pageViews = Math.toIntExact(article.getPageViews());
|
|
|
|
+ if (pageViews != null) {
|
|
|
|
+ communityArticle.setPageViews(pageViews);
|
|
|
|
+ } else {
|
|
|
|
+ // 处理 pageViews 为 null 的情况,比如设置为 0 或记录日志
|
|
|
|
+ communityArticle.setPageViews(0);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
String address = null;
|
|
String address = null;
|
|
try {
|
|
try {
|
|
address = AddressUtils.getAddress(null);
|
|
address = AddressUtils.getAddress(null);
|