潘志宝
2024-09-26 1373561069f7e19383dbc178c19787c4b3f0df3b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.iailab;
 
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
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初始化失败");
        }
 
    }
 
 
    public static void main(String[] args) {
        SpringApplication.run(ModelServiceApplication.class, args);
    }
 
    /**
     * 容器初始化后加载路由
     *
     * @param strings
     */
    @Override
    public void run(String... strings) {
    }
}