From 0fdd97203f1f8a7f3e4df221e8d79a4f387d14d6 Mon Sep 17 00:00:00 2001 From: Yjoioooo <5403234+zj_Gitttttttte@user.noreply.gitee.com> Date: 星期一, 06 三月 2023 19:07:00 +0800 Subject: [PATCH] !296 add 新增租户套餐同步功能 * update 修改按钮简化为同步套餐 * update 修改同步租户套餐接口message错误描述 * update 修改同步租户套餐权限字符 * update 修改状态修改权限字符 * add 租户管理新增租户套餐同步功能 --- ruoyi-common/ruoyi-common-translation/src/main/java/com/ruoyi/common/translation/core/handler/TranslationHandler.java | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 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 0a8f1b3..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,22 +29,27 @@ /** * 鍏ㄥ眬缈昏瘧瀹炵幇绫绘槧灏勫櫒 */ - 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())) { value = ReflectUtils.invokeGetter(gen.getCurrentValue(), translation.mapper()); } - String result = trans.translation(value, translation.other()); - gen.writeString(StringUtils.isNotBlank(result) ? result : value.toString()); + // 濡傛灉涓� null 鐩存帴鍐欏嚭 + if (ObjectUtil.isNull(value)) { + gen.writeNull(); + return; + } + Object result = trans.translation(value, translation.other()); + gen.writeObject(result); } else { - gen.writeString(value.toString()); + gen.writeObject(value); } } -- Gitblit v1.9.3