From 6697e53613d5ce562a19795ab41b19803c2bb93d Mon Sep 17 00:00:00 2001
From: 905086 <k2049@qq.com>
Date: Sat, 07 Nov 2026 19:26:30 +0800
Subject: [PATCH] feat(tools): 新增工具卸载功能及相关实现
---
fluttergamebox/lib/api/api_service.dart | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/fluttergamebox/lib/api/api_service.dart b/fluttergamebox/lib/api/api_service.dart
index a0c78b5..65e230b 100644
--- a/fluttergamebox/lib/api/api_service.dart
+++ b/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 '';
--
Gitblit v1.10.0