Browse Source

设置SpringContextHolder

tags/24080901
WendyYang 1 year ago
parent
commit
7d1be645c2
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/App.java

+ 7
- 1
pmapi/src/main/java/com/ningdatech/pmapi/App.java View File

@@ -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();
}

}

Loading…
Cancel
Save