From 2174c8098724cbb7df20be3b48fdbc58d583267e Mon Sep 17 00:00:00 2001 From: 101captain <237651143@qq.com> Date: 星期五, 03 十二月 2021 13:25:41 +0800 Subject: [PATCH] 12/3 base64文件上传 --- springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/MessageUtils.java | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/MessageUtils.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/MessageUtils.java new file mode 100644 index 0000000..9e63c85 --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/MessageUtils.java @@ -0,0 +1,25 @@ +package com.panzhihua.common.utlis; + +import org.springframework.context.MessageSource; +import org.springframework.context.i18n.LocaleContextHolder; + +/** + * 获取i18n资源文件 + * + * @author ruoyi + */ +public class MessageUtils { + /** + * 根据消息键和参数 获取消息 委托给spring messageSource + * + * @param code + * 消息键 + * @param args + * 参数 + * @return 获取国际化翻译值 + */ + public static String message(String code, Object... args) { + MessageSource messageSource = SpringUtils.getBean(MessageSource.class); + return messageSource.getMessage(code, args, LocaleContextHolder.getLocale()); + } +} -- Gitblit v1.7.1