gigibox
2023-06-19 942f3416b333304bde50f0dca5581595f397eafa
config/config.go
@@ -15,10 +15,12 @@
   SqlUsername    string `json:"sql_username"`    // 数据库用户
   SqlPassword    string `json:"sql_password"`    // 数据库密码
   NsqServer      string `json:"nsq_server"`      // nsq TCP服务端地址
   NsqWebApi      string `json:"nsq_server"`      // nsq HTTP接口地址
   NsqWebApi      string `json:"nsq_webapi"`      // nsq HTTP接口地址
   OrderTopic     string `json:"order_topic"`     // 订单上报的topic
   InventoryTopic string `json:"inventory_topic"` // 库存上报的topic
   QueryTopic     string `json:"query_topic"`     // 金蝶查询接口的topic
   SyncInterval   int    `json:"interval"`        // 同步的时间间隔, 单位/秒
   Debug          bool   `json:"debug"`           // 本地调试, 取本地数据
}
const configPath = "config.json"
@@ -33,9 +35,11 @@
   Options.SqlPassword = "123456"
   Options.NsqServer = "fai365.com:4150"
   Options.NsqWebApi = "http://121.31.232.83:9080/api/nsq/pub?topic=your_topic"
   Options.OrderTopic = "/province/city/factoryNo/kingdee_seOrder"
   Options.InventoryTopic = "/province/city/factoryNo/kingdee_inventory"
   Options.OrderTopic = "aps.factory.erp.seorder"
   Options.InventoryTopic = "aps.factory.erp.inventory"
   Options.QueryTopic = "aps.factory.erp.k3resource"
   Options.SyncInterval = 60
   Options.Debug = false
}
func Load() {
@@ -49,8 +53,6 @@
      fd := json.NewDecoder(file)
      fd.Decode(&Options)
      fmt.Printf("%v\n", Options)
   }
}