From e18f2001fda0eccfbf2aa617e127c70b92083909 Mon Sep 17 00:00:00 2001 From: dengzedong <dengzedong@email> Date: 星期六, 14 九月 2024 16:37:00 +0800 Subject: [PATCH] mpk 模型方法添加参数、选项 dao --- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/ModelServiceApplication.java | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 42 insertions(+), 1 deletions(-) diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/ModelServiceApplication.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/ModelServiceApplication.java index e306c71..df28449 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/ModelServiceApplication.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/ModelServiceApplication.java @@ -3,12 +3,53 @@ import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import com.iail.IAILMDK; import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.scheduling.annotation.EnableAsync; +import java.io.File; +import java.io.InputStream; +import java.util.Objects; +import java.util.Properties; + +@EnableAsync @SpringBootApplication public class ModelServiceApplication implements CommandLineRunner { + /*static { + //加载动态链接库 + try { + Properties properties = new Properties(); + InputStream in = ModelServiceApplication.class.getClassLoader().getResourceAsStream("iailmdk.properties"); + properties.load(in); + String mdkInitPath = properties.getProperty("mdk-init-path"); + System.out.println("mdkInitPath=" + mdkInitPath); + IAILMDK.initWithBean(mdkInitPath, false); + } catch (Exception e) { + e.printStackTrace(); + System.out.println("动态链接库IAILMDK初始化失败"); + } + + try { + System.out.println("动态加载dll"); + String dllDir = Objects.requireNonNull(ModelServiceApplication.class.getClassLoader().getResource("dll")).getPath(); + File dir = new File(dllDir); + if (dir.exists()) { + File[] files = dir.listFiles(); + if (files.length > 0) { + for (File file : files) { + System.out.println("加载:" + file.getAbsolutePath()); + System.load(file.getAbsolutePath()); + } + } + } + } catch (Exception e) { + e.printStackTrace(); + System.out.println("动态加载dll失败"); + } + + } +*/ public static void main(String[] args) { SpringApplication.run(ModelServiceApplication.class, args); -- Gitblit v1.9.3