commit init

This commit is contained in:
weihongyang
2022-06-20 16:26:51 +08:00
commit 7aaa6700b3
171 changed files with 9178 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
package com.cnbm.common.utils;
import org.springframework.context.MessageSource;
import org.springframework.context.i18n.LocaleContextHolder;
/**
* @Author weihongyang
* @Date 2022/6/7 2:42 PM
* @Version 1.0
*/
public class MessageUtils {
private static MessageSource messageSource;
static {
messageSource = (MessageSource)SpringContextUtils.getBean("messageSource");
}
public static String getMessage(int code){
return getMessage(code, new String[0]);
}
public static String getMessage(int code, String... params){
return messageSource.getMessage(code+"", params, LocaleContextHolder.getLocale());
}
}