yangys
2024-05-07 eaf6878850c029ac359d60409c7c9fcfa09c1852
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());
    }
}