import '../utils/http/response_model.dart';
import '../utils/http/dio_request.dart';
import '../models/bo/webrtc_bo.dart';

class WebrtcRepository {
  /// 获取 WebRTC SDP 信令交换地址
  ///
  /// [deviceNo] 设备摄像头序列号（cameraSn）
  /// [password] 设备 WiFi 密码
  Future<ResponseModel<WebrtcAddressBO>> getAddress({
    required String deviceNo,
    required String password,
  }) {
    return DioRequest.instance.get<WebrtcAddressBO>(
      '/veepai/cloud/webrtc/address',
      queryParameters: {'cameraSn': deviceNo, 'password': password},
      fromJsonT: (data) =>
          WebrtcAddressBO.fromJson(data as Map<String, dynamic>),
    );
  }
}
