yangys
2024-04-24 11b76c76bcd4f235fb75959b53b64c6d9a2dd71e
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());
    }
}