CZT
2023-09-14 db72a27d10fdc4de0926fb8c7cc411ec0d4ea51b
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
package com.ld.igds.protocol.fzzy;
 
import com.ld.igds.data.ConfigData;
import com.ld.igds.protocol.fzzy.server.FzzyServerEngine;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
 
/**
 * 配置随系统自动启动服务 -- 执行顺序20-29
 */
@Component(ServerRunner.BEAN_ID)
@Order(value = 21)
public class ServerRunner implements CommandLineRunner {
 
    public static final String BEAN_ID = "fzzy.serverRunner";
 
    @Autowired
    private ConfigData configData;
 
    @Override
    public void run(String... strings) throws Exception {
 
        if (configData.getActive().indexOf("pro") >= 0) {
            FzzyServerEngine.start(FzzyServerEngine.default_port);
        }
        if (configData.getActive().indexOf("linux") >= 0) {
            FzzyServerEngine.start(FzzyServerEngine.default_port);
        }
    }
}