1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- package main
- import (
- "fmt"
- "github.com/yuguorong/go/log"
- "os"
- "github.com/ammeter/api"
- "github.com/ammeter/config"
- "github.com/ammeter/platform"
- )
- //Port 端口
- const (
- REQ_AMGW_URL = "/platform/dev/get-4G-gateway-list"
- REQ_AMMETER_URL = "/platform/dev/get-ammeter-list"
- REQ_AIR_URL = "/platform/dev/get-sair-list"
- GATEWAY_VERSION = "2.0.1.0"
- )
- func init() {
- }
- func main() {
- if len(os.Args) > 1 {
- inputParam := os.Args[1]
- switch inputParam {
- case "info":
- fmt.Println(GATEWAY_VERSION)
- os.Exit(0)
- }
- }
- log.Info("***************************************************")
- log.Infof(" ammeter start. version:%s ", GATEWAY_VERSION)
- log.Info("***************************************************")
- //config.GetSysConfig().SetValue("Bus/DtuServer/Port", DEF_FTP_PORT)
- config.GetSysConfig().SetValue("GatwayVersion", GATEWAY_VERSION)
- log.Info("process start...")
- p := platform.PaPlatform{}
- p.SetGatewayUrl("/platform/dev/get-4G-gateway-list")
- p.SetModel("ammeter", REQ_AMMETER_URL)
- p.SetModel("SA10", REQ_AIR_URL)
- p.SaveModel()
- api.RestServerStart()
- platform.StartServer()
- }
|