feat: iot_card/device Store 新增 UpdateRealnamePolicy 方法
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -250,3 +250,10 @@ func (s *DeviceStore) UpdatePollingStatus(ctx context.Context, deviceID uint, en
|
||||
Where("id = ?", deviceID).
|
||||
Update("enable_polling", enablePolling).Error
|
||||
}
|
||||
|
||||
// UpdateRealnamePolicy 更新设备的实名认证策略
|
||||
func (s *DeviceStore) UpdateRealnamePolicy(ctx context.Context, deviceID uint, realnamePolicy string) error {
|
||||
return s.db.WithContext(ctx).Model(&model.Device{}).
|
||||
Where("id = ?", deviceID).
|
||||
Update("realname_policy", realnamePolicy).Error
|
||||
}
|
||||
|
||||
@@ -124,6 +124,13 @@ func (s *IotCardStore) UpdatePollingStatus(ctx context.Context, cardID uint, ena
|
||||
Update("enable_polling", enablePolling).Error
|
||||
}
|
||||
|
||||
// UpdateRealnamePolicy 更新卡的实名认证策略
|
||||
func (s *IotCardStore) UpdateRealnamePolicy(ctx context.Context, cardID uint, realnamePolicy string) error {
|
||||
return s.db.WithContext(ctx).Model(&model.IotCard{}).
|
||||
Where("id = ?", cardID).
|
||||
Update("realname_policy", realnamePolicy).Error
|
||||
}
|
||||
|
||||
func (s *IotCardStore) Delete(ctx context.Context, id uint) error {
|
||||
return s.db.WithContext(ctx).Delete(&model.IotCard{}, id).Error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user