service/device_plc.go
@@ -43,10 +43,10 @@ func (slf DevicePlcService) GetDeviceChannelAmount() (int, error) { plcConfig, code := slf.GetDevicePlc() if code != ecode.OK || plcConfig.Id == 0 { return 0, errors.New("请先配置PLC") return 0, errors.New("未获取到PLC地址,请在工艺模型库中上传!") } if len(plcConfig.Details) == 0 { return 0, errors.New("请先配置PLC") return 0, errors.New("未获取到PLC地址,请在工艺模型库中上传!") } return len(plcConfig.Details) / 2, nil }