Authored by peuei

fix

... ... @@ -91,13 +91,14 @@ public class GrassArticleListener extends AbstractMqListener<GrassArticle> {
if (contentData == null) {
return "";
}
try {
return contentData;
/*try {
Map map = ContentConvertUtil.jsonString2Map(contentData);
String coverImg = (String) map.get("url");
return coverImg;
} catch (Exception e) {
return "";
}
}*/
}
// 如果不是更新操作,直接返回
return sourceObject;
... ...
... ... @@ -73,14 +73,17 @@ public class PublicArticleBlockService {
publicArticleBlockRepository.save(targetObject);
// 更新 public_article.cover_img
if (targetObject.getOrderBy() == 0) {
try {
if (targetObject.getContentData() != null) {
publicArticleRepository.updateCoverImgByArticleIdAndArticleTypes(targetObject.getContentData(), targetObject.getArticleId(), ServiceConstant.articleTypes);
}
/*try {
Map map = ContentConvertUtil.jsonString2Map(targetObject.getContentData());
String coverImg = (String) map.get("url");
if (coverImg != null)
publicArticleRepository.updateCoverImgByArticleIdAndArticleTypes(coverImg, targetObject.getArticleId(), ServiceConstant.articleTypes);
} catch (Exception e) {
log.error("update public_article.cover_img goes error with exception {}", e);
}
}*/
}
}
... ...