From df6867ee052790c3d690f341c422540e47ae5ec3 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期一, 16 一月 2023 10:52:14 +0800 Subject: [PATCH] update 优化 默认开启复杂结构 resultMap 自动映射 简化xml编码(多结构实体需带上主键id) --- ruoyi-framework/src/main/java/com/ruoyi/framework/config/I18nConfig.java | 50 ++++++++++++++++++++++++-------------------------- 1 files changed, 24 insertions(+), 26 deletions(-) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/I18nConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/I18nConfig.java index 48b341b..f664f03 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/I18nConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/I18nConfig.java @@ -1,13 +1,12 @@ package com.ruoyi.framework.config; import cn.hutool.core.util.StrUtil; -import org.jetbrains.annotations.NotNull; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.LocaleResolver; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.util.Locale; /** @@ -18,31 +17,30 @@ @Configuration public class I18nConfig { - @Bean - public LocaleResolver localeResolver() { - return new I18nLocaleResolver(); - } + @Bean + public LocaleResolver localeResolver() { + return new I18nLocaleResolver(); + } - /** - * 鑾峰彇璇锋眰澶村浗闄呭寲淇℃伅 - */ - static class I18nLocaleResolver implements LocaleResolver { + /** + * 鑾峰彇璇锋眰澶村浗闄呭寲淇℃伅 + */ + static class I18nLocaleResolver implements LocaleResolver { - @NotNull - @Override - public Locale resolveLocale(HttpServletRequest httpServletRequest) { - String language = httpServletRequest.getHeader("content-language"); - Locale locale = Locale.getDefault(); - if (StrUtil.isNotBlank(language)) { - String[] split = language.split("_"); - locale = new Locale(split[0], split[1]); - } - return locale; - } + @Override + public Locale resolveLocale(HttpServletRequest httpServletRequest) { + String language = httpServletRequest.getHeader("content-language"); + Locale locale = Locale.getDefault(); + if (StrUtil.isNotBlank(language)) { + String[] split = language.split("_"); + locale = new Locale(split[0], split[1]); + } + return locale; + } - @Override - public void setLocale(@NotNull HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Locale locale) { + @Override + public void setLocale(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Locale locale) { - } - } + } + } } -- Gitblit v1.9.3