mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
1、system服务国际化相关表免校验租户、token配置;2、system服务枚举相关国际化处理;3、system服务资金管理easyexcel导出表头国际化处理;
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
||||
package com.cf.imes.framework.web.config;
|
||||
|
||||
import com.cf.imes.framework.web.core.rpc.LanguageRequestInterceptor;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
/**
|
||||
* WEB RPC 组件的自动配置
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2025/11/20 13:55
|
||||
*/
|
||||
@AutoConfiguration
|
||||
public class ChenfengWebRpcAutoConfiguration {
|
||||
/**
|
||||
* 国际化组件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public LanguageRequestInterceptor languageRequestInterceptor() {
|
||||
return new LanguageRequestInterceptor();
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.cf.imes.framework.web.core.rpc;
|
||||
|
||||
import feign.RequestInterceptor;
|
||||
import feign.RequestTemplate;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* 国际化 的 RequestInterceptor 实现类:Feign 请求时,将 {@link LocaleContextHolder} 设置到 header 中,继续透传给被调用的服务
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@Slf4j
|
||||
public class LanguageRequestInterceptor implements RequestInterceptor {
|
||||
|
||||
@Override
|
||||
@SneakyThrows
|
||||
public void apply(RequestTemplate requestTemplate) {
|
||||
Locale locale = LocaleContextHolder.getLocale();
|
||||
if (locale != null) {
|
||||
requestTemplate.header(HttpHeaders.ACCEPT_LANGUAGE, locale.toString());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+1
@@ -2,6 +2,7 @@ com.cf.imes.framework.apilog.config.ChenfengApiLogAutoConfiguration
|
||||
com.cf.imes.framework.jackson.config.ChenfengJacksonAutoConfiguration
|
||||
com.cf.imes.framework.swagger.config.ChenfengSwaggerAutoConfiguration
|
||||
com.cf.imes.framework.web.config.ChenfengWebAutoConfiguration
|
||||
com.cf.imes.framework.web.config.ChenfengWebRpcAutoConfiguration
|
||||
com.cf.imes.framework.apilog.config.ChenfengApiLogRpcAutoConfiguration
|
||||
com.cf.imes.framework.async.ChenfengAsyncAutoConfiguration
|
||||
com.cf.imes.framework.banner.config.ChenfengBannerAutoConfiguration
|
||||
|
||||
Reference in New Issue
Block a user