|
|
|
@ -1,18 +1,15 @@
|
|
|
|
package m9zApi
|
|
|
|
package m9zApi
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
|
|
|
|
"github.com/gogf/gf/v2/errors/gerror"
|
|
|
|
"github.com/gogf/gf/v2/errors/gerror"
|
|
|
|
|
|
|
|
"tgk-touch/internal/module/meterFirm"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/towgo/towgo/towgo"
|
|
|
|
"github.com/towgo/towgo/towgo"
|
|
|
|
"tgk-touch/internal/global"
|
|
|
|
"tgk-touch/internal/global"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
var deviceInfo map[string]interface{}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func Init() {
|
|
|
|
func Init() {
|
|
|
|
marshal, _ := json.Marshal(g.Config().DeviceInfo)
|
|
|
|
|
|
|
|
json.Unmarshal(marshal, &deviceInfo)
|
|
|
|
|
|
|
|
towgo.SetFunc("/m9z/fault/list", faultList)
|
|
|
|
towgo.SetFunc("/m9z/fault/list", faultList)
|
|
|
|
towgo.SetFunc("/m9z/fault/batchExec", execFailByIds)
|
|
|
|
towgo.SetFunc("/m9z/fault/batchExec", execFailByIds)
|
|
|
|
// 获取设备输出状态参数
|
|
|
|
// 获取设备输出状态参数
|
|
|
|
@ -81,7 +78,8 @@ func Init() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func getTouchDeviceId(rpc towgo.JsonRpcConnection) {
|
|
|
|
func getTouchDeviceId(rpc towgo.JsonRpcConnection) {
|
|
|
|
|
|
|
|
deviceInfo := g.Config().DeviceInfo
|
|
|
|
|
|
|
|
deviceInfo.MeterFirm = meterFirm.Manager().Get()
|
|
|
|
rpc.WriteResult(deviceInfo)
|
|
|
|
rpc.WriteResult(deviceInfo)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
func faultDelete(rpc towgo.JsonRpcConnection) {
|
|
|
|
func faultDelete(rpc towgo.JsonRpcConnection) {
|
|
|
|
|