| | |
| | | |
| | | import ( |
| | | "apsClient/conf" |
| | | "apsClient/constvar" |
| | | "apsClient/model/common" |
| | | "apsClient/pkg/logx" |
| | | "apsClient/pkg/safe" |
| | | "errors" |
| | | "fmt" |
| | | "time" |
| | | ) |
| | | |
| | | func Init() error { |
| | |
| | | } |
| | | |
| | | safe.Go(func() { |
| | | _ = Consume(fmt.Sprintf("aps.%v.scheduleTask", conf.Conf.NsqConf.NodeId), conf.Conf.System.DeviceId) |
| | | caller := NewCaller(fmt.Sprintf(constvar.NsqTopicGetPlcAddress, conf.Conf.NsqConf.NodeId), fmt.Sprintf(constvar.NsqTopicSendPlcAddress, conf.Conf.NsqConf.NodeId)) |
| | | var addressResult common.ResponsePlcAddress |
| | | err := caller.Call(common.RequestPlcAddress{DeviceId: conf.Conf.System.DeviceId}, &addressResult, time.Second*2) |
| | | if err != nil { |
| | | logx.Infof("SendParams2 err: %v", err.Error()) |
| | | } |
| | | }) |
| | | |
| | | safe.Go(func() { |
| | | _ = Consume(fmt.Sprintf(constvar.NsqTopicScheduleTask, conf.Conf.NsqConf.NodeId), conf.Conf.System.DeviceId) |
| | | }) |
| | | |
| | | safe.Go(func() { |
| | | _ = Consume(fmt.Sprintf(constvar.NsqTopicSendPlcAddress, conf.Conf.NsqConf.NodeId), conf.Conf.System.DeviceId) |
| | | }) |
| | | |
| | | return nil |