From 2ea23e2364f742f528fb8b97657212c174d1bbd7 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期六, 21 十月 2023 14:06:59 +0800 Subject: [PATCH] 增加切换serf状态接口(调试用) --- service/device_plc.go | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/service/device_plc.go b/service/device_plc.go index 90c3e51..fc5fadc 100644 --- a/service/device_plc.go +++ b/service/device_plc.go @@ -1,6 +1,7 @@ package service import ( + "apsClient/conf" "apsClient/model" "apsClient/model/request" "apsClient/pkg/ecode" @@ -18,7 +19,7 @@ } func (slf DevicePlcService) GetDevicePlc() (*model.DevicePlc, int) { - DevicePlc, err := model.NewDevicePlcSearch().SetOrder("id desc").First() + DevicePlc, err := model.NewDevicePlcSearch().SetDeviceId(conf.Conf.System.DeviceId).First() if err == gorm.ErrRecordNotFound { return &model.DevicePlc{ Brand: "", -- Gitblit v1.8.0