export class DeviceInfo {
  private _lastActiveAt: Date;

  constructor(
    public readonly deviceId: string,
    public readonly deviceName: string,
    public readonly addedAt: Date,
    lastActiveAt: Date,
    public readonly deviceInfo?: Record<string, unknown>, // 完整的设备信息 JSON
  ) {
    this._lastActiveAt = lastActiveAt;
  }

  get lastActiveAt(): Date {
    return this._lastActiveAt;
  }

  updateActivity(): void {
    this._lastActiveAt = new Date();
  }
}
