diff --git a/src/main/java/run/halo/app/model/properties/CommentProperties.java b/src/main/java/run/halo/app/model/properties/CommentProperties.java index f124dead1..b75e38def 100644 --- a/src/main/java/run/halo/app/model/properties/CommentProperties.java +++ b/src/main/java/run/halo/app/model/properties/CommentProperties.java @@ -4,7 +4,8 @@ package run.halo.app.model.properties; * Comment properties. * * @author johnniang - * @date 4/1/19 + * @author ryanwang + * @date 2019-04-01 */ public enum CommentProperties implements PropertyEnum { @@ -22,9 +23,7 @@ public enum CommentProperties implements PropertyEnum { PAGE_SIZE("comment_page_size", Integer.class, "10"), - CONTENT_PLACEHOLDER("comment_content_placeholder", String.class, ""), - - CUSTOM_STYLE("comment_custom_style", String.class, ""); + CONTENT_PLACEHOLDER("comment_content_placeholder", String.class, ""); private final String value; diff --git a/src/main/java/run/halo/app/service/impl/AdminServiceImpl.java b/src/main/java/run/halo/app/service/impl/AdminServiceImpl.java index 6b8ffca48..9a6e2ca32 100644 --- a/src/main/java/run/halo/app/service/impl/AdminServiceImpl.java +++ b/src/main/java/run/halo/app/service/impl/AdminServiceImpl.java @@ -3,6 +3,7 @@ package run.halo.app.service.impl; import cn.hutool.core.lang.Validator; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.ApplicationEventPublisher; import org.springframework.lang.NonNull; import org.springframework.stereotype.Service; import org.springframework.util.Assert; @@ -58,6 +59,8 @@ public class AdminServiceImpl implements AdminService { private final StringCacheStore cacheStore; + private final ApplicationEventPublisher eventPublisher; + private final String driverClassName; public AdminServiceImpl(PostService postService, @@ -70,6 +73,7 @@ public class AdminServiceImpl implements AdminService { UserService userService, LinkService linkService, StringCacheStore cacheStore, + ApplicationEventPublisher eventPublisher, @Value("${spring.datasource.driver-class-name}") String driverClassName) { this.postService = postService; this.sheetService = sheetService; @@ -81,6 +85,7 @@ public class AdminServiceImpl implements AdminService { this.userService = userService; this.linkService = linkService; this.cacheStore = cacheStore; + this.eventPublisher = eventPublisher; this.driverClassName = driverClassName; } @@ -112,7 +117,7 @@ public class AdminServiceImpl implements AdminService { if (SecurityContextHolder.getContext().isAuthenticated()) { // If the user has been logged in - throw new BadRequestException("You have been logged in, do not log in repeatedly please"); + throw new BadRequestException("您已登录,请不要重复登录"); } // Generate new token @@ -125,7 +130,7 @@ public class AdminServiceImpl implements AdminService { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication == null) { - throw new BadRequestException("You haven't logged in yet, so you can't log out"); + throw new BadRequestException("您尚未登录,因此无法注销"); } // Get current user diff --git a/src/main/java/run/halo/app/service/impl/AttachmentServiceImpl.java b/src/main/java/run/halo/app/service/impl/AttachmentServiceImpl.java index 9aeef3fa0..86715c4e2 100644 --- a/src/main/java/run/halo/app/service/impl/AttachmentServiceImpl.java +++ b/src/main/java/run/halo/app/service/impl/AttachmentServiceImpl.java @@ -188,7 +188,7 @@ public class AttachmentServiceImpl extends AbstractCrudService 0) { - throw new AlreadyExistsException("The attachment with path " + attachment.getPath() + " exists already"); + throw new AlreadyExistsException("附件路径为 " + attachment.getPath() + " 已经存在"); } }