yangys
2024-09-04 04c57331cf84c8f606c2838dcb6fe5463fb9b68c
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());
    }
}