From b4645daf2a9943afb4603e30eef1897cdca157c5 Mon Sep 17 00:00:00 2001 From: zlyx <1242874891@qq.com> Date: 星期一, 06 三月 2023 13:07:05 +0800 Subject: [PATCH] add 新增 迁移 4.X EasyExcel枚举类数据翻译注解功能 ; fix 修正 !pr292 相关问题, 回退特殊类转换写法 ; --- ruoyi-common/ruoyi-common-translation/src/main/java/com/ruoyi/common/translation/core/handler/TranslationHandler.java | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ruoyi-common/ruoyi-common-translation/src/main/java/com/ruoyi/common/translation/core/handler/TranslationHandler.java b/ruoyi-common/ruoyi-common-translation/src/main/java/com/ruoyi/common/translation/core/handler/TranslationHandler.java index 69a2e45..fcd122c 100644 --- a/ruoyi-common/ruoyi-common-translation/src/main/java/com/ruoyi/common/translation/core/handler/TranslationHandler.java +++ b/ruoyi-common/ruoyi-common-translation/src/main/java/com/ruoyi/common/translation/core/handler/TranslationHandler.java @@ -29,13 +29,13 @@ /** * 鍏ㄥ眬缈昏瘧瀹炵幇绫绘槧灏勫櫒 */ - public static final Map<String, TranslationInterface> TRANSLATION_MAPPER = new ConcurrentHashMap<>(); + public static final Map<String, TranslationInterface<?>> TRANSLATION_MAPPER = new ConcurrentHashMap<>(); private Translation translation; @Override public void serialize(Object value, JsonGenerator gen, SerializerProvider serializers) throws IOException { - TranslationInterface trans = TRANSLATION_MAPPER.get(translation.type()); + TranslationInterface<?> trans = TRANSLATION_MAPPER.get(translation.type()); if (ObjectUtil.isNotNull(trans)) { // 濡傛灉鏄犲皠瀛楁涓嶄负绌� 鍒欏彇鏄犲皠瀛楁鐨勫�� if (StringUtils.isNotBlank(translation.mapper())) { @@ -46,8 +46,8 @@ gen.writeNull(); return; } - String result = trans.translation(value, translation.other()); - gen.writeString(result); + Object result = trans.translation(value, translation.other()); + gen.writeObject(result); } else { gen.writeObject(value); } -- Gitblit v1.9.3