Fixed import markdown cased bugs.

pull/195/head
ruibaby 2019-06-08 23:27:16 +08:00
parent 3ff6e4eeea
commit 8529510730
1 changed files with 6 additions and 30 deletions

View File

@ -19,11 +19,7 @@ import run.halo.app.event.logger.LogEvent;
import run.halo.app.event.post.PostVisitEvent; import run.halo.app.event.post.PostVisitEvent;
import run.halo.app.model.dto.CategoryDTO; import run.halo.app.model.dto.CategoryDTO;
import run.halo.app.model.dto.TagDTO; import run.halo.app.model.dto.TagDTO;
import run.halo.app.model.entity.Category; import run.halo.app.model.entity.*;
import run.halo.app.model.entity.Post;
import run.halo.app.model.entity.PostCategory;
import run.halo.app.model.entity.PostTag;
import run.halo.app.model.entity.Tag;
import run.halo.app.model.enums.LogType; import run.halo.app.model.enums.LogType;
import run.halo.app.model.enums.PostStatus; import run.halo.app.model.enums.PostStatus;
import run.halo.app.model.params.PostQuery; import run.halo.app.model.params.PostQuery;
@ -32,33 +28,13 @@ import run.halo.app.model.vo.ArchiveYearVO;
import run.halo.app.model.vo.PostDetailVO; import run.halo.app.model.vo.PostDetailVO;
import run.halo.app.model.vo.PostListVO; import run.halo.app.model.vo.PostListVO;
import run.halo.app.repository.PostRepository; import run.halo.app.repository.PostRepository;
import run.halo.app.service.CategoryService; import run.halo.app.service.*;
import run.halo.app.service.OptionService; import run.halo.app.utils.*;
import run.halo.app.service.PostCategoryService;
import run.halo.app.service.PostCommentService;
import run.halo.app.service.PostService;
import run.halo.app.service.PostTagService;
import run.halo.app.service.TagService;
import run.halo.app.utils.DateUtils;
import run.halo.app.utils.HaloUtils;
import run.halo.app.utils.MarkdownUtils;
import run.halo.app.utils.ServiceUtils;
import run.halo.app.utils.SlugUtils;
import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root; import javax.persistence.criteria.Root;
import javax.persistence.criteria.Subquery; import javax.persistence.criteria.Subquery;
import java.util.Calendar; import java.util.*;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.function.Supplier; import java.util.function.Supplier;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -347,7 +323,6 @@ public class PostServiceImpl extends BasePostServiceImpl<Post> implements PostSe
if (null == tag) { if (null == tag) {
tag = new Tag(); tag = new Tag();
tag.setName(ele); tag.setName(ele);
tag.setSlugName(SlugUtils.slugify(ele));
String slugName = SlugUtils.slugify(ele); String slugName = SlugUtils.slugify(ele);
tag.setSlugName(HaloUtils.initializeUrlIfBlank(slugName)); tag.setSlugName(HaloUtils.initializeUrlIfBlank(slugName));
tag = tagService.create(tag); tag = tagService.create(tag);
@ -359,7 +334,8 @@ public class PostServiceImpl extends BasePostServiceImpl<Post> implements PostSe
if (null == category) { if (null == category) {
category = new Category(); category = new Category();
category.setName(ele); category.setName(ele);
category.setSlugName(SlugUtils.slugify(ele)); String slugName = SlugUtils.slugify(ele);
category.setSlugName(HaloUtils.initializeUrlIfBlank(slugName));
category.setDescription(ele); category.setDescription(ele);
category = categoryService.create(category); category = categoryService.create(category);
} }