更新分享
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
|
||||
|
||||
class ApiResponse<T> {
|
||||
int? code;
|
||||
T? data;
|
||||
String? msg;
|
||||
int? total;
|
||||
|
||||
ApiResponse({required this.code, this.data, this.msg});
|
||||
ApiResponse({required this.code, this.data, this.msg, this.total});
|
||||
factory ApiResponse.fromJson(
|
||||
Map<String, dynamic> json, T Function(Object?) fromJsonT) {
|
||||
return ApiResponse<T>(
|
||||
code: json['code'] as int,
|
||||
data: json['data'] != null ? fromJsonT(json['data']) : null,
|
||||
msg: json['msg'] as String?,
|
||||
total: json['total'] as int?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user