From 79914dabac38d83676ea16ff65da8d941a099285 Mon Sep 17 00:00:00 2001
From: Jay <csj123456>
Date: 星期二, 08 十月 2024 10:38:01 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/ModelServiceApplication.java |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 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 10db3e6..4cb632e 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
@@ -1,10 +1,13 @@
 package com.iailab;
 
+import iail.mdk.model.common.Environment;
 import org.springframework.boot.CommandLineRunner;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.scheduling.annotation.EnableAsync;
 
+import java.io.File;
+import java.io.InputStream;
 import java.util.Properties;
 
 @EnableAsync
@@ -15,13 +18,17 @@
         //加载动态链接库
         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);
-//            System.load(mdkInitPath + File.separator + "IAIL.MDK.Mid.Windows.dll");
-//            Environment env = new Environment();
-//            env.init();
+            InputStream in = ModelServiceApplication.class.getClassLoader().getResourceAsStream("iailmdk.properties");
+            properties.load(in);
+            String mdkInitPath = properties.getProperty("mdk-init-path");
+            System.out.println("mdkInitPath=" + mdkInitPath);
+            File file = new File(mdkInitPath + File.separator + "IAIL.MDK.Mid.Windows.dll");
+            if (!file.exists()) {
+                throw new RuntimeException("动态链接库IAIL.MDK.Mid.Windows.dll文件不存在," + file.getAbsolutePath());
+            }
+            System.load(file.getAbsolutePath());
+            Environment env = new Environment();
+            env.init();
         } catch (Exception e) {
             e.printStackTrace();
             System.out.println("动态链接库IAIL.MDK.Mid.Windows.dll初始化失败");

--
Gitblit v1.9.3