main.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. package main
  2. import (
  3. "net"
  4. "github.com/yuguorong/go/log"
  5. "github.com/ammeter/api"
  6. "github.com/ammeter/config"
  7. "github.com/ammeter/platform"
  8. )
  9. //Port 端口
  10. const (
  11. REQ_AMGW_URL = "/platform/dev/get-4G-gateway-list"
  12. REQ_AMMETER_URL = "/platform/dev/get-ammeter-list"
  13. REQ_AIR_URL = "/platform/dev/get-sair-list"
  14. DEF_FTP_PORT = 10010
  15. )
  16. var Port string
  17. var maxConnCount = 100
  18. var connclientSize = 0
  19. var connlist map[string]net.Conn
  20. var deviceList map[string][]string
  21. func init() {
  22. connlist = make(map[string]net.Conn)
  23. deviceList = map[string][]string{
  24. "9521003872": {"2108", "05420005", "05420003", "05420002"}, //6f
  25. "9521003712": {"2108", "05420001"}, //1F
  26. "9521003534": {"2108", "05420006"}, //-1F
  27. "9521003697": {"2108", "05420004"}, //5c
  28. }
  29. }
  30. func main() {
  31. config.GetSysConfig().SetValue("Bus/DtuServer/Port", DEF_FTP_PORT)
  32. log.Info("process start...")
  33. p := platform.PaPlatform{}
  34. p.SetGatewayUrl("/platform/dev/get-4G-gateway-list")
  35. p.SetModel("ammeter", REQ_AMMETER_URL)
  36. p.SetModel("SA10", REQ_AIR_URL)
  37. p.SaveModel()
  38. api.RestServerStart()
  39. platform.StartServer()
  40. }