zhangzengfei
2023-08-04 88da1e13a073e8b5656387a246d827593fbd6163
config/config.go
@@ -9,9 +9,12 @@
)
type Config struct {
   NsqServer    string `json:"nsq_server"`     // nsq TCP服务端地址
   PLCDataTopic string `json:"plc_data_topic"` // 订单上报的topic
   PLCSetTopic  string `json:"plc_set_topic"`  // 订单上报的topic
   NsqServer        string `json:"nsq_server"`          // nsq TCP服务端地址
   PubPLCDataTopic  string `json:"plc_data_topic"`      // 发布plc数据的topic
   PLCSetTopic      string `json:"plc_set_topic"`       // 接收plc配置数据的topic
   SubDeviceTopic   string `json:"sub_device_topic"`    // 接收设备变更通知的topic
   ApsDeviceWebApi  string `json:"aps_device_webapi"`   // 获取设备列表的接口, aps 提供, http接口
   ApsPLCDataWebApi string `json:"aps_plc_data_webapi"` // 上传给aps plc数据的接口地址. aps 提供, http接口
}
const configPath = "config.json"
@@ -20,7 +23,10 @@
func DefaultConfig() {
   Options.NsqServer = "fai365.com:4150"
   Options.PLCDataTopic = "aps.factory.plc.livedata"
   Options.PubPLCDataTopic = "aps.factory.plc.livedata"
   Options.PLCSetTopic = ""
   Options.ApsDeviceWebApi = ""
   Options.ApsPLCDataWebApi = ""
}
func Load() {