27 lines
715 B
Java
27 lines
715 B
Java
|
|
package com.zhgd.config;
|
||
|
|
|
||
|
|
import com.zhgd.xmgl.util.MessageUtil;
|
||
|
|
import org.springframework.context.ApplicationListener;
|
||
|
|
import org.springframework.context.MessageSource;
|
||
|
|
import org.springframework.context.event.ContextRefreshedEvent;
|
||
|
|
import org.springframework.stereotype.Component;
|
||
|
|
|
||
|
|
import javax.annotation.Resource;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @program: wisdomSite
|
||
|
|
* @description:
|
||
|
|
* @author: Mr.Peng
|
||
|
|
* @create: 2020-09-09 18:32
|
||
|
|
**/
|
||
|
|
|
||
|
|
@Component
|
||
|
|
public class ApplicationEvent implements ApplicationListener<ContextRefreshedEvent> {
|
||
|
|
@Resource
|
||
|
|
protected MessageSource messageSource;
|
||
|
|
@Override
|
||
|
|
public void onApplicationEvent(ContextRefreshedEvent event) {
|
||
|
|
MessageUtil.setMessageSource(messageSource);
|
||
|
|
}
|
||
|
|
}
|