import 'package:laki_icu_app/models/bo/cabin_detail_response.dart';
import 'package:laki_icu_app/repositories/cabin_repository.dart';

class CabinService {
  final CabinRepository _repository;

  CabinService() : _repository = CabinRepository.instance;

  /// 获取舱详情
  ///
  /// [carbinSn] 舱序列号（设备 SN）
  /// 返回 [CabinDetailResponse]，包含 cameraSn、wifiPwd、petInfo 等
  Future<CabinDetailResponse> getCabinDetail(String carbinSn) async {
    final result = await _repository.getCabinDetail(carbinSn);
    if (result.success && result.data != null) {
      return result.data!;
    }
    throw Exception(result.msg);
  }
}
