yangys
2024-05-09 60e317f7782c718d28920060fd686d2092c99c1e
1
2
3
4
5
6
7
8
9
10
11
12
package com.qianwen.smartman.common.utils;
 
import com.qianwen.core.tool.utils.SpringUtil;
import org.springframework.context.MessageSource;
import org.springframework.context.i18n.LocaleContextHolder;
 
public class MessageUtils {
    public static String message(String code, Object... args) {
        MessageSource messageSource = (MessageSource) SpringUtil.getBean(MessageSource.class);
        return messageSource.getMessage(code, args, LocaleContextHolder.getLocale());
    }
}