Skip to content

Commit

Permalink
4.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
feiniaojin committed Apr 27, 2024
1 parent 94c7d2a commit d02a6bc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.feiniaojin</groupId>
<artifactId>graceful-response</artifactId>
<version>4.0.0-boot3</version>
<version>4.0.1-boot3</version>
<name>Graceful Response for Boot3</name>
<description>Help Spring Boot web application responses gracefully!</description>
<url>https://github.com/feiniaojin/graceful-response.git</url>
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/com/feiniaojin/gracefulresponse/AutoConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ResourceBundleMessageSource;

import java.util.Locale;

/**
* 全局返回值处理的自动配置.
*
Expand Down Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/**
* 带数据的异常响应
* @Author twolf
* @author twolf
*/
public class GracefulResponseDataException extends GracefulResponseException {
private final Logger logger = LoggerFactory.getLogger(GracefulResponseDataException.class);
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/i18n/empty-messages_zh_CN.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# ????????????Locale????

0 comments on commit d02a6bc

Please sign in to comment.