Files
ttstd_family_care/lib/features/device/domain/device_repository.dart

53 lines
2.2 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import 'package:ttstd_family_care/features/device/domain/device_models.dart';
/// 设备仓储,封装设备信息/定位/应用列表/绑定设备列表的获取。
abstract class DeviceRepository {
/// 当前用户已绑定的设备列表。
Future<List<DeviceBrief>> getMyDevices();
/// 绑定设备(手动输入 SN 或扫码获取 SN
///
/// 成功返回 null失败返回错误提示。
Future<String?> bindDevice(String sn, {String? remark});
/// 解绑设备。
///
/// 成功返回 null失败返回错误提示。
Future<String?> unbindDevice(String sn);
/// 已绑定设备基本信息(无上报数据时返回 null
Future<DeviceSystemInfo?> getDeviceInfo(String sn);
/// 已绑定设备最新定位信息(无上报数据时返回 null
Future<DeviceLocation?> getLocation(String sn);
/// 已绑定设备已安装应用列表。
Future<List<DeviceApkInfo>> getApks(String sn);
/// 已绑定设备最近截图列表。
Future<List<ScreenshotVO>> getRecentScreenshots(String sn);
/// 向设备下发操作指令(重启/关机/截屏/刷新/定位/拍照等)。
///
/// [op] 为后端操作标识,如 `reboot` / `shutdown` / `screenshot` / `refresh` / `locate` / `take_photo`。
/// [extra] 为可选的附加 query 参数(如远程拍照时的 `camera``0` 后置 / `1` 前置)。
/// 成功返回 null失败返回错误提示。
Future<String?> sendDeviceOp(String sn, String op, {Map<String, dynamic>? extra});
/// 对指定应用执行操作(打开/停止/卸载/清除数据)。
///
/// [op] 为后端操作标识:`launch` / `stop` / `uninstall` / `clear_data`。
/// 成功返回 null失败返回错误提示。
Future<String?> sendAppOp(String sn, String op, String packageName);
/// 删除单张设备截图(家属端 client 接口)。
///
/// [sn] 设备序列号,[id] 截图ID。成功返回 null失败返回错误提示。
Future<String?> deleteScreenshot(String sn, int id);
/// 清空设备全部截图(家属端 client 接口)。
///
/// [sn] 设备序列号。成功返回 null失败返回错误提示。
Future<String?> clearScreenshots(String sn);
}