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/impl/OssUrlTranslationImpl.java | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ruoyi-common/ruoyi-common-translation/src/main/java/com/ruoyi/common/translation/core/impl/OssUrlTranslationImpl.java b/ruoyi-common/ruoyi-common-translation/src/main/java/com/ruoyi/common/translation/core/impl/OssUrlTranslationImpl.java index 00a3f38..e0d2781 100644 --- a/ruoyi-common/ruoyi-common-translation/src/main/java/com/ruoyi/common/translation/core/impl/OssUrlTranslationImpl.java +++ b/ruoyi-common/ruoyi-common-translation/src/main/java/com/ruoyi/common/translation/core/impl/OssUrlTranslationImpl.java @@ -12,16 +12,17 @@ * * @author Lion Li */ -@Component @AllArgsConstructor @TranslationType(type = TransConstant.OSS_ID_TO_URL) -public class OssUrlTranslationImpl implements TranslationInterface { +public class OssUrlTranslationImpl implements TranslationInterface<String> { private final OssService ossService; public String translation(Object key, String other) { if (key instanceof String ids) { return ossService.selectUrlByIds(ids); + } else if (key instanceof Long id) { + return ossService.selectUrlByIds(id.toString()); } return null; } -- Gitblit v1.9.3