Bladeren bron

设置SpringContextHolder

tags/24080901
WendyYang 1 jaar geleden
bovenliggende
commit
7d1be645c2
1 gewijzigde bestanden met toevoegingen van 7 en 1 verwijderingen
  1. +7
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/App.java

+ 7
- 1
pmapi/src/main/java/com/ningdatech/pmapi/App.java Bestand weergeven

@@ -1,11 +1,12 @@
package com.ningdatech.pmapi;

import com.ningdatech.basic.util.SpringUtils;
import com.ningdatech.pmapi.common.util.SpringContextHolder;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
@@ -30,4 +31,9 @@ public class App {
SpringUtils.setApplicationContext(context);
}

@Bean
public SpringContextHolder springContextHolder() {
return new SpringContextHolder();
}

}

Laden…
Annuleren
Opslaan