diff --git a/pom.xml b/pom.xml index 1ee52bb..cbdb092 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.feiniaojin graceful-response - 4.0.0-boot3 + 4.0.1-boot3 Graceful Response for Boot3 Help Spring Boot web application responses gracefully! https://github.com/feiniaojin/graceful-response.git diff --git a/src/main/java/com/feiniaojin/gracefulresponse/AutoConfig.java b/src/main/java/com/feiniaojin/gracefulresponse/AutoConfig.java index 5d85975..9e683d9 100644 --- a/src/main/java/com/feiniaojin/gracefulresponse/AutoConfig.java +++ b/src/main/java/com/feiniaojin/gracefulresponse/AutoConfig.java @@ -14,6 +14,8 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.support.ResourceBundleMessageSource; +import java.util.Locale; + /** * 全局返回值处理的自动配置. * @@ -91,9 +93,9 @@ public GrI18nAdvice grI18nAdvice() { @ConditionalOnProperty(prefix = "graceful-response", name = "i18n", havingValue = "true") public MessageSource grMessageSource() { ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); - messageSource.setBasenames("i18n/graceful-response"); + messageSource.setBasenames("i18n/graceful-response","i18n/empty-messages"); messageSource.setDefaultEncoding("UTF-8"); - messageSource.setCacheSeconds(30); + messageSource.setDefaultLocale(Locale.CHINA); return messageSource; } } diff --git a/src/main/java/com/feiniaojin/gracefulresponse/GracefulResponseDataException.java b/src/main/java/com/feiniaojin/gracefulresponse/GracefulResponseDataException.java index 26402fe..41f900f 100644 --- a/src/main/java/com/feiniaojin/gracefulresponse/GracefulResponseDataException.java +++ b/src/main/java/com/feiniaojin/gracefulresponse/GracefulResponseDataException.java @@ -7,7 +7,7 @@ /** * 带数据的异常响应 - * @Author twolf + * @author twolf */ public class GracefulResponseDataException extends GracefulResponseException { private final Logger logger = LoggerFactory.getLogger(GracefulResponseDataException.class); diff --git a/src/main/resources/i18n/empty-messages_zh_CN.properties b/src/main/resources/i18n/empty-messages_zh_CN.properties new file mode 100644 index 0000000..6f6d86c --- /dev/null +++ b/src/main/resources/i18n/empty-messages_zh_CN.properties @@ -0,0 +1 @@ +# ????????????Locale????