|
|
@@ -3,6 +3,7 @@ package com.zhongshu.iot.server.core.init;
|
|
|
import com.zhongshu.iot.server.core.service.openApi.OpenAPIRegisterService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.boot.CommandLineRunner;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
@@ -22,12 +23,18 @@ public class OpenApiInit implements CommandLineRunner {
|
|
|
@Autowired
|
|
|
OpenAPIRegisterService openAPIRegisterService;
|
|
|
|
|
|
+ @Value("${openapi.initRegister}")
|
|
|
+ public boolean initRegister = false;
|
|
|
+
|
|
|
@Override
|
|
|
public void run(String... args) throws Exception {
|
|
|
CompletableFuture.runAsync(() -> {
|
|
|
try {
|
|
|
TimeUnit.SECONDS.sleep(30);
|
|
|
- openAPIRegisterService.initRegisterPAIS();
|
|
|
+ log.info("initRegister {}", initRegister);
|
|
|
+ if (initRegister) {
|
|
|
+ openAPIRegisterService.initRegisterPAIS();
|
|
|
+ }
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|