
import 'dart:ffi';

import 'classify_photo_platform_interface.dart';

class ClassifyPhoto {
  Future<String?> getPlatformVersion() {
    return ClassifyPhotoPlatform.instance.getPlatformVersion();
  }

  Future<List<Map<String, dynamic>>?> getPhoto() {
    return ClassifyPhotoPlatform.instance.getPhoto();
  }

  // 新增的分离方法
  // 获取截图
  Future<List<Map<String, dynamic>>?> getScreenshots() {
    return ClassifyPhotoPlatform.instance.getScreenshots();
  }

  // 获取模糊照片
  Future<List<Map<String, dynamic>>?> getBlurryPhotos() {
    return ClassifyPhotoPlatform.instance.getBlurryPhotos();
  }

  // 获取人物照片
  Future<List<Map<String, dynamic>>?> getPeoplePhotos() {
    return ClassifyPhotoPlatform.instance.getPeoplePhotos();
  }

  // 获取相似照片
  Future<List<Map<String, dynamic>>?> getSimilarPhotos() {
    return ClassifyPhotoPlatform.instance.getSimilarPhotos();
  }

  Future<Map<String, int>> getStorageInfo() {
    return ClassifyPhotoPlatform.instance.getStorageInfo();
  }

  Future<bool> checkTrialEligibility(String appleId) {
    return ClassifyPhotoPlatform.instance.checkTrialEligibility(appleId);
  }

  Future<Map<String, dynamic>> getPhotoExif(String filePath) async {
    try {
      return await ClassifyPhotoPlatform.instance.getPhotoExif(filePath);
    } catch (e) {
      print('获取照片 EXIF 信息失败: $e');
      return {};
    }
  }

  Future<void> finishTransaction() {
    return ClassifyPhotoPlatform.instance.finishTransaction();
  }

  Future<int> calculatePhotosSize(List<String> assetIds) {
    return ClassifyPhotoPlatform.instance.calculatePhotoSize(assetIds);
  }
}
