|
|
@ -221,16 +221,17 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit |
|
|
|
draftEntity.setPreviewContent(""); |
|
|
|
return; |
|
|
|
} |
|
|
|
String content = ""; |
|
|
|
for (int i = 0; i < fromDTO.getContentList().size(); i++) { |
|
|
|
if (DraftConstant.TEXT.equals(fromDTO.getContentList().get(i).getContentType())) { |
|
|
|
String content = fromDTO.getContentList().get(i).getContent(); |
|
|
|
content = fromDTO.getContentList().get(i).getContent(); |
|
|
|
if (content.length() > DraftConstant.PREVIEW_CONTENT_MAX_LENGTH) { |
|
|
|
content = content.substring(NumConstant.ZERO, DraftConstant.PREVIEW_CONTENT_MAX_LENGTH); |
|
|
|
} |
|
|
|
draftEntity.setPreviewContent(content); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
draftEntity.setPreviewContent(content); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -263,7 +264,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit |
|
|
|
if (!CollectionUtils.isEmpty(fromDTO.getTagNameList())) { |
|
|
|
List<String> tagNameList = fromDTO.getTagNameList(); |
|
|
|
tagNameList = tagNameList.stream().distinct().collect(Collectors.toList()); |
|
|
|
String tagNamesStr = StringUtils.join(tagNameList, "、"); |
|
|
|
String tagNamesStr = StringUtils.join(tagNameList, "\\|"); |
|
|
|
draftEntity.setTags(tagNamesStr); |
|
|
|
} |
|
|
|
draftEntity.setIsTop(fromDTO.getIsTop()); |
|
|
@ -308,8 +309,8 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit |
|
|
|
throw new RenException("草稿已删除"); |
|
|
|
} |
|
|
|
//只有为发布的才能保存修改
|
|
|
|
if (!DraftConstant.UNPUBLISH.equals(draftEntity.getStatusFlag())) { |
|
|
|
log.warn("saveDraftAttr draftId:{} publishStatus have published"); |
|
|
|
if (DraftConstant.AUDITING.equals(draftEntity.getStatusFlag()) || DraftConstant.PUBLISHED.equals(draftEntity.getStatusFlag())) { |
|
|
|
log.warn("saveDraftAttr draftId:{} publishStatus have published",draftId); |
|
|
|
throw new RenException("草稿发布状态错误"); |
|
|
|
} |
|
|
|
return draftEntity; |
|
|
|