#
vincentlu
9 小时以前 766d5e2f27f90e096b4ce5ecfe28878b774efb10
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
49
50
51
52
53
54
package com.zy.acs.manager.common.config;
 
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
 
import java.net.InetAddress;
import java.net.UnknownHostException;
 
/**
 * 输送线plc系统配置
 * Created by luxiaotao on 2018/10/15
 */
@Configuration
@ConfigurationProperties(prefix = "convey-plc")
public class ConveyorProperties {
 
    public static String HOST_NAME;
 
    static {
        try {
            HOST_NAME = InetAddress.getLocalHost().getHostName();
        } catch (UnknownHostException e) {
            System.err.println("find hostname err");
        }
    }
 
    private String host;
 
    private Integer port;
 
    public static String getHostName() {
        return HOST_NAME;
    }
 
    public static void setHostName(String hostName) {
        HOST_NAME = hostName;
    }
 
    public String getHost() {
        return host;
    }
 
    public void setHost(String host) {
        this.host = host;
    }
 
    public Integer getPort() {
        return port;
    }
 
    public void setPort(Integer port) {
        this.port = port;
    }
}