mirror of https://github.com/halo-dev/halo
Remove useless import.
parent
884d23c2c3
commit
6617cb565c
|
@ -1,6 +1,5 @@
|
||||||
package run.halo.app.listener;
|
package run.halo.app.listener;
|
||||||
|
|
||||||
import com.sun.nio.zipfs.JarFileSystemProvider;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.context.event.ApplicationStartedEvent;
|
import org.springframework.boot.context.event.ApplicationStartedEvent;
|
||||||
|
@ -10,20 +9,15 @@ import org.springframework.core.Ordered;
|
||||||
import org.springframework.core.annotation.Order;
|
import org.springframework.core.annotation.Order;
|
||||||
import org.springframework.util.ResourceUtils;
|
import org.springframework.util.ResourceUtils;
|
||||||
import run.halo.app.config.properties.HaloProperties;
|
import run.halo.app.config.properties.HaloProperties;
|
||||||
import run.halo.app.model.entity.User;
|
|
||||||
import run.halo.app.model.params.UserParam;
|
|
||||||
import run.halo.app.model.properties.PrimaryProperties;
|
import run.halo.app.model.properties.PrimaryProperties;
|
||||||
import run.halo.app.model.support.CreateCheck;
|
|
||||||
import run.halo.app.service.OptionService;
|
import run.halo.app.service.OptionService;
|
||||||
import run.halo.app.service.ThemeService;
|
import run.halo.app.service.ThemeService;
|
||||||
import run.halo.app.service.UserService;
|
import run.halo.app.service.UserService;
|
||||||
import run.halo.app.utils.FileUtils;
|
import run.halo.app.utils.FileUtils;
|
||||||
import run.halo.app.utils.ValidationUtils;
|
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.nio.file.*;
|
import java.nio.file.*;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The method executed after the application is started.
|
* The method executed after the application is started.
|
||||||
|
|
|
@ -147,7 +147,7 @@ public class PostServiceImpl extends BasePostServiceImpl<Post> implements PostSe
|
||||||
@Override
|
@Override
|
||||||
public PostDetailVO createBy(Post postToCreate, Set<Integer> tagIds, Set<Integer> categoryIds, boolean autoSave) {
|
public PostDetailVO createBy(Post postToCreate, Set<Integer> tagIds, Set<Integer> categoryIds, boolean autoSave) {
|
||||||
PostDetailVO createdPost = createOrUpdate(postToCreate, tagIds, categoryIds);
|
PostDetailVO createdPost = createOrUpdate(postToCreate, tagIds, categoryIds);
|
||||||
if(!autoSave){
|
if (!autoSave) {
|
||||||
// Log the creation
|
// Log the creation
|
||||||
LogEvent logEvent = new LogEvent(this, createdPost.getId().toString(), LogType.POST_PUBLISHED, createdPost.getTitle());
|
LogEvent logEvent = new LogEvent(this, createdPost.getId().toString(), LogType.POST_PUBLISHED, createdPost.getTitle());
|
||||||
eventPublisher.publishEvent(logEvent);
|
eventPublisher.publishEvent(logEvent);
|
||||||
|
@ -160,7 +160,7 @@ public class PostServiceImpl extends BasePostServiceImpl<Post> implements PostSe
|
||||||
// Set edit time
|
// Set edit time
|
||||||
postToUpdate.setEditTime(DateUtils.now());
|
postToUpdate.setEditTime(DateUtils.now());
|
||||||
PostDetailVO updatedPost = createOrUpdate(postToUpdate, tagIds, categoryIds);
|
PostDetailVO updatedPost = createOrUpdate(postToUpdate, tagIds, categoryIds);
|
||||||
if(!autoSave){
|
if (!autoSave) {
|
||||||
// Log the creation
|
// Log the creation
|
||||||
LogEvent logEvent = new LogEvent(this, updatedPost.getId().toString(), LogType.POST_EDITED, updatedPost.getTitle());
|
LogEvent logEvent = new LogEvent(this, updatedPost.getId().toString(), LogType.POST_EDITED, updatedPost.getTitle());
|
||||||
eventPublisher.publishEvent(logEvent);
|
eventPublisher.publishEvent(logEvent);
|
||||||
|
@ -349,7 +349,7 @@ public class PostServiceImpl extends BasePostServiceImpl<Post> implements PostSe
|
||||||
.orElseGet(LinkedList::new)
|
.orElseGet(LinkedList::new)
|
||||||
.stream()
|
.stream()
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.map(tag -> new TagDTO().<TagDTO>convertFrom(tag))
|
.map(tag -> (TagDTO) new TagDTO().convertFrom(tag))
|
||||||
.collect(Collectors.toList()));
|
.collect(Collectors.toList()));
|
||||||
|
|
||||||
// Set categories
|
// Set categories
|
||||||
|
@ -357,7 +357,7 @@ public class PostServiceImpl extends BasePostServiceImpl<Post> implements PostSe
|
||||||
.orElseGet(LinkedList::new)
|
.orElseGet(LinkedList::new)
|
||||||
.stream()
|
.stream()
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.map(category -> new CategoryDTO().<CategoryDTO>convertFrom(category))
|
.map(category -> (CategoryDTO) new CategoryDTO().convertFrom(category))
|
||||||
.collect(Collectors.toList()));
|
.collect(Collectors.toList()));
|
||||||
|
|
||||||
// Set comment count
|
// Set comment count
|
||||||
|
|
Loading…
Reference in New Issue