refactor: 修改初始化listener执行顺序

This commit is contained in:
wangjiahao 2022-03-02 22:34:05 +08:00
parent ed8b17f8e6
commit a0a1b1f96e
2 changed files with 3 additions and 1 deletions

View File

@ -9,7 +9,7 @@ import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@Component
@Order(value = 1)
@Order(value = 2)
public class DataSourceInitStartListener implements ApplicationListener<ApplicationReadyEvent> {
@Resource
private DatasourceService datasourceService;

View File

@ -9,12 +9,14 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Date;
@Component
@Order(value = 1)
public class SystemInitListener implements ApplicationListener<ApplicationReadyEvent> {
private final Logger logger = LoggerFactory.getLogger(ClassloaderResponsity.class);