This commit is contained in:
sion
2026-04-07 01:05:05 +08:00
parent edad10ff06
commit 5ca1274607
83 changed files with 1561 additions and 1241 deletions

View File

@@ -3,13 +3,13 @@ import '../../core/network/api_response.dart';
import '../../core/network/dio_client.dart';
import '../models/order_models.dart';
/// 充提服
/// 充提服
class FundService {
final DioClient _client;
FundService(this._client);
/// 取默认钱包地址
/// 取默認錢包地址
Future<ApiResponse<ColdWallet>> getDefaultWallet() async {
final response = await _client.get<Map<String, dynamic>>(
ApiEndpoints.defaultWallet,
@@ -21,10 +21,10 @@ class FundService {
response.message,
);
}
return ApiResponse.fail(response.message ?? '获取钱包地址失');
return ApiResponse.fail(response.message ?? '獲取錢包地址失');
}
/// 申充值
/// 申充值
/// 返回包含 orderNo, amount, status, walletAddress, walletNetwork 的信息
Future<ApiResponse<Map<String, dynamic>>> deposit({
required String amount,
@@ -39,7 +39,7 @@ class FundService {
);
}
/// 用户确认已打款
/// 用戶確認已打款
Future<ApiResponse<void>> confirmPay(String orderNo) async {
return _client.post<void>(
ApiEndpoints.confirmPay,
@@ -47,7 +47,7 @@ class FundService {
);
}
/// 申请提现
/// 申請提現
Future<ApiResponse<Map<String, dynamic>>> withdraw({
required String amount,
required String withdrawAddress,
@@ -67,7 +67,7 @@ class FundService {
);
}
/// 取可用的提现网络列表
/// 取可用的提現網絡列表
Future<ApiResponse<List<String>>> getWalletNetworks() async {
final response = await _client.get<List<dynamic>>(
ApiEndpoints.walletNetworks,
@@ -78,10 +78,10 @@ class FundService {
response.message,
);
}
return ApiResponse.fail(response.message ?? '获取网络列表失');
return ApiResponse.fail(response.message ?? '獲取網絡列表失');
}
/// 取消订单
/// 取消訂單
Future<ApiResponse<void>> cancelOrder(String orderNo) async {
return _client.post<void>(
ApiEndpoints.cancelOrder,
@@ -89,7 +89,7 @@ class FundService {
);
}
/// 取充提记录
/// 取充提記錄
Future<ApiResponse<Map<String, dynamic>>> getOrders({
int? type,
int pageNum = 1,
@@ -107,7 +107,7 @@ class FundService {
);
}
/// 解析充提记录列表
/// 解析充提記錄列表
List<OrderFund> parseOrderList(List<dynamic>? list) {
if (list == null) return [];
return list.map((e) => OrderFund.fromJson(e as Map<String, dynamic>)).toList();