From f655ec81dd6bb978303f2812d03c6d8740e8ed7d Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期三, 08 十一月 2023 15:33:04 +0800 Subject: [PATCH] debug --- api/v1/device.go | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/v1/device.go b/api/v1/device.go index 5c08540..6f16b3a 100644 --- a/api/v1/device.go +++ b/api/v1/device.go @@ -29,7 +29,7 @@ if !ok { return } - if params.CurrentDeviceID != "" { + if params.CurrentDeviceID == "" { ctx.Fail(ecode.ParamsErr) return } @@ -45,7 +45,7 @@ return } service.SetDeviceIDToFile(params.CurrentDeviceID) - conf.Conf.SerfClusterStatus = params.CurrentDeviceID + conf.Conf.CurrentDeviceID = params.CurrentDeviceID err = crontask.RestartTask(conf.Conf.SerfClusterStatus != constvar.SerfClusterStatusSlave) if err != nil { logx.Errorf("restart task failed:%v", err) @@ -67,7 +67,7 @@ if !ok { return } - list, err := service.GetDeviceIDList() + list, err := service.GetDeviceList() if err != nil { ctx.Fail(ecode.DBErr) return @@ -75,7 +75,7 @@ resp := response.DeviceListResponse{ SystemDeviceID: conf.Conf.System.DeviceId, CurrentDeviceID: conf.Conf.CurrentDeviceID, - DeviceIDList: list, + DeviceList: list, SystemDeviceStatus: response.SystemDeviceStatusNormal, ClusterStatus: conf.Conf.SerfClusterStatus, ClusterNodeQuantity: conf.Conf.ClusterNodeQuantity, -- Gitblit v1.8.0