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

class InspectionRoomRepository {
  /// 获取设备巡检房间列表
  Future<ResponseModel<List<InspectionRoomBO>>> getRooms() {
    return DioRequest.instance.get<List<InspectionRoomBO>>(
      '/app/device/inspection/rooms',
      fromJsonT: (data) {
        final list = data as List<dynamic>;
        return list
            .map((e) => InspectionRoomBO.fromJson(e as Map<String, dynamic>))
            .toList();
      },
    );
  }
}