LighthouseApp/lib/app/model/response/kr_payment_methods.dart
speakeloudest 75d4c48e41
Some checks failed
Build Windows / build (push) Has been cancelled
feat: 源码提交
2025-10-19 23:30:54 -07:00

49 lines
1.2 KiB
Dart
Executable File

import 'package:kaer_with_panels/app/utils/kr_log_util.dart';
class KRPaymentMethods {
/// 支付方式列表
final List<KRPaymentMethod> list;
KRPaymentMethods({required this.list});
factory KRPaymentMethods.fromJson(Map<String, dynamic> json) {
final List<dynamic> rawList = json['list'] ?? [];
return KRPaymentMethods(
list: rawList.map((item) => KRPaymentMethod.fromJson(item)).toList(),
);
}
}
class KRPaymentMethod {
final int id;
final String name;
final String platform;
final String icon;
final int feeMode;
final int feePercent;
final int feeAmount;
KRPaymentMethod({
required this.id,
required this.name,
required this.platform,
required this.icon,
required this.feeMode,
required this.feePercent,
required this.feeAmount,
});
factory KRPaymentMethod.fromJson(Map<String, dynamic> json) {
KRLogUtil.kr_i(json.toString());
return KRPaymentMethod(
id: (json['id'] ?? 0),
name: json['name'] ?? '',
platform: json['platform'] ?? '',
icon: json['icon'] ?? '',
feeMode: json['fee_mode'] ?? 0,
feePercent: json['fee_percent'] ?? 0,
feeAmount: json['fee_amount'] ?? 0,
);
}
}