mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 02:48:34 +08:00
[fix] 更新设备状态方法参数,从id改为name
This commit is contained in:
@@ -18,7 +18,7 @@ type (
|
|||||||
FindListPage(page, pageSize int, data entity.Device) (*[]entity.DeviceRes, int64, error)
|
FindListPage(page, pageSize int, data entity.Device) (*[]entity.DeviceRes, int64, error)
|
||||||
FindList(data entity.Device) (*[]entity.DeviceRes, error)
|
FindList(data entity.Device) (*[]entity.DeviceRes, error)
|
||||||
Update(data entity.Device) (*entity.Device, error)
|
Update(data entity.Device) (*entity.Device, error)
|
||||||
UpdateStatus(id, linkStatus string) error
|
UpdateStatus(name, linkStatus string) error
|
||||||
Delete(ids []string) error
|
Delete(ids []string) error
|
||||||
FindDeviceCount() (entity.DeviceCount, error)
|
FindDeviceCount() (entity.DeviceCount, error)
|
||||||
FindDeviceCountGroupByLinkStatus() ([]entity.DeviceCountLinkStatus, error)
|
FindDeviceCountGroupByLinkStatus() ([]entity.DeviceCountLinkStatus, error)
|
||||||
@@ -185,8 +185,8 @@ func (m *deviceModelImpl) Update(data entity.Device) (*entity.Device, error) {
|
|||||||
err := global.Db.Table(m.table).Updates(&data).Error
|
err := global.Db.Table(m.table).Updates(&data).Error
|
||||||
return &data, err
|
return &data, err
|
||||||
}
|
}
|
||||||
func (m *deviceModelImpl) UpdateStatus(id, linkStatus string) error {
|
func (m *deviceModelImpl) UpdateStatus(name, linkStatus string) error {
|
||||||
return global.Db.Table(m.table).Where("id", id).Update("link_status", linkStatus).Update("last_time", time.Now()).Error
|
return global.Db.Table(m.table).Where("name", name).Update("link_status", linkStatus).Update("last_time", time.Now()).Error
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *deviceModelImpl) Delete(ids []string) error {
|
func (m *deviceModelImpl) Delete(ids []string) error {
|
||||||
|
|||||||
Reference in New Issue
Block a user