|
|
@@ -11,12 +11,14 @@ package cc.iotkit;
|
|
|
|
|
|
import cc.iotkit.config.EmbeddedElasticSearchConfig;
|
|
|
import cc.iotkit.config.EmbeddedRedisConfig;
|
|
|
+import cc.iotkit.config.UserAuditor;
|
|
|
import com.gitee.starblues.loader.DevelopmentMode;
|
|
|
import com.gitee.starblues.loader.launcher.SpringBootstrap;
|
|
|
import com.gitee.starblues.loader.launcher.SpringMainBootstrap;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.boot.SpringApplication;
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
+import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
|
|
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|
|
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
|
|
@@ -25,11 +27,11 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
|
|
@SpringBootApplication
|
|
|
@EnableTransactionManagement
|
|
|
@EnableWebMvc
|
|
|
-@EnableJpaAuditing
|
|
|
+@EnableJpaAuditing(auditorAwareRef = "userAuditor")
|
|
|
public class Application implements SpringBootstrap {
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
-// System.setProperty("disabledEmbeddedEs", "true");
|
|
|
+ System.setProperty("disabledEmbeddedEs", "true");
|
|
|
System.setProperty("disabledEmbeddedRedis", "true");
|
|
|
if (EmbeddedElasticSearchConfig.embeddedEnable()) {
|
|
|
EmbeddedElasticSearchConfig.startEmbeddedElasticSearch();
|
|
|
@@ -51,4 +53,9 @@ public class Application implements SpringBootstrap {
|
|
|
public String developmentMode() {
|
|
|
return DevelopmentMode.ISOLATION;
|
|
|
}
|
|
|
+
|
|
|
+ @Bean
|
|
|
+ public UserAuditor setUserAuditorAware(){
|
|
|
+ return new UserAuditor();
|
|
|
+ }
|
|
|
}
|