YYC
2023-07-19 e4b8ad94cc1f48b2e47c022f19e70cc68b1e925b
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
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);
        }
    }
}