905086
2026-11-07 6697e53613d5ce562a19795ab41b19803c2bb93d
fluttergamebox/lib/api/api_service.dart
@@ -15,6 +15,7 @@
  final String gpuReq;
  final String ramReq;
  final String versionNote;
  final String launchExe; // 启动程序相对路径(相对游戏安装目录)
  final String cover;
  final String video;
  final List<String> screenshots;
@@ -37,6 +38,7 @@
    required this.gpuReq,
    required this.ramReq,
    required this.versionNote,
    required this.launchExe,
    required this.cover,
    required this.video,
    required this.screenshots,
@@ -75,6 +77,7 @@
      gpuReq: j['gpu_req'] ?? '',
      ramReq: j['ram_req'] ?? '',
      versionNote: j['version_note'] ?? '',
      launchExe: j['launch_exe'] ?? '',
      cover: j['cover'] ?? '',
      video: j['video'] ?? '',
      screenshots: shots,
@@ -115,6 +118,7 @@
  final String cover;
  final String description;
  final String fileUrl;
  final String launchExe;
  Tool({
    required this.id,
    required this.name,
@@ -122,6 +126,7 @@
    required this.cover,
    required this.description,
    required this.fileUrl,
    this.launchExe = '',
  });
  factory Tool.fromJson(Map<String, dynamic> j) => Tool(
        id: j['id'],
@@ -130,6 +135,7 @@
        cover: j['cover'] ?? '',
        description: j['description'] ?? '',
        fileUrl: j['file_url'] ?? '',
        launchExe: j['launch_exe'] ?? '',
      );
}
@@ -187,6 +193,9 @@
    return (res['data'] as List).map((e) => Tool.fromJson(e)).toList();
  }
  static Future<Map<String, dynamic>> toolDownloadInfo(int toolId) async =>
      await ApiClient.get('/api/tools/$toolId/download');
  static Future<String> announcements() async {
    final res = await ApiClient.get('/api/announcements');
    if (res['code'] != 0) return '';