sgj
2026-03-23 452cf744b08f2148729427fec50b07a4cf0cad31
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
package com.fzzy.igds;
 
import com.fzzy.igds.iot.server.IotServerEngine;
import com.fzzy.igds.quantity.server.BhznQuantityServerEngine;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
 
import javax.annotation.Resource;
 
/**
 * @Description 可以根据配置文件灵活调整,配置随系统自动启动服务 -- 执行顺序10-19
 * @Author CZT
 * @Date 2026/01/08 16:36
 */
@Component(ServerRunner.BEAN_ID)
@Order(value = 10)
public class ServerRunner implements CommandLineRunner {
 
    public static final String BEAN_ID = "quantity.serverRunner";
 
    @Resource
    private BhznQuantityServerEngine quantityServerEngine;
    @Resource
    private IotServerEngine iotServerEngine;
 
    @Override
    public void run(String... strings) throws Exception {
 
        //数量检测端口
        quantityServerEngine.start(BhznQuantityServerEngine.PORT);
 
        //IOT设备端口
        iotServerEngine.start(IotServerEngine.PORT);
 
    }
}