11
This commit is contained in:
1 parent
295b4058be
commit
08bf352984
21 files changed
+1109
-234
No files matched your search
@@ -21,20 +21,21 @@ class ServiceBase<T> {
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class ServiceListBase<T> {
|
||||
String? msg;
|
||||
int? code;
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
List<T>? data;
|
||||
class ServicePageBase {
|
||||
int current;
|
||||
int pages;
|
||||
int size;
|
||||
int total;
|
||||
|
||||
ServiceListBase({
|
||||
this.msg,
|
||||
this.code,
|
||||
this.data,
|
||||
ServicePageBase({
|
||||
this.current = 1,
|
||||
this.pages = 1,
|
||||
this.size = 10,
|
||||
this.total = 0,
|
||||
});
|
||||
|
||||
factory ServiceListBase.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceListBaseFromJson(json);
|
||||
factory ServicePageBase.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServicePageBaseFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ServiceListBaseToJson(this);
|
||||
Map<String, dynamic> toJson() => _$ServicePageBaseToJson(this);
|
||||
}
|
||||
@@ -20,14 +20,18 @@ Map<String, dynamic> _$ServiceBaseToJson<T>(ServiceBase<T> instance) =>
|
||||
'data': instance.data,
|
||||
};
|
||||
|
||||
ServiceListBase<T> _$ServiceListBaseFromJson<T>(Map<String, dynamic> json) =>
|
||||
ServiceListBase<T>(
|
||||
msg: json['msg'] as String?,
|
||||
code: (json['code'] as num?)?.toInt(),
|
||||
ServicePageBase _$ServicePageBaseFromJson(Map<String, dynamic> json) =>
|
||||
ServicePageBase(
|
||||
current: (json['current'] as num?)?.toInt() ?? 1,
|
||||
pages: (json['pages'] as num?)?.toInt() ?? 1,
|
||||
size: (json['size'] as num?)?.toInt() ?? 10,
|
||||
total: (json['total'] as num?)?.toInt() ?? 0,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceListBaseToJson<T>(ServiceListBase<T> instance) =>
|
||||
Map<String, dynamic> _$ServicePageBaseToJson(ServicePageBase instance) =>
|
||||
<String, dynamic>{
|
||||
'msg': instance.msg,
|
||||
'code': instance.code,
|
||||
'current': instance.current,
|
||||
'pages': instance.pages,
|
||||
'size': instance.size,
|
||||
'total': instance.total,
|
||||
};
|
||||
@@ -201,3 +201,110 @@ class ServiceQRCode {
|
||||
|
||||
Map<String, dynamic> toJson() => _$ServiceQRCodeToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class ServiceHardOrder {
|
||||
/// 用户名
|
||||
final String? username;
|
||||
|
||||
/// 用户手机号
|
||||
final String? userMobile;
|
||||
|
||||
/// 用户头像
|
||||
final String? userAvatar;
|
||||
|
||||
ServiceHardOrder({
|
||||
this.username,
|
||||
this.userMobile,
|
||||
this.userAvatar,
|
||||
});
|
||||
|
||||
factory ServiceHardOrder.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceHardOrderFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ServiceHardOrderToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class ServiceOpenCard {
|
||||
/// 用户名
|
||||
String? username;
|
||||
|
||||
/// 用户手机号
|
||||
String? mobile;
|
||||
|
||||
/// 用户头像
|
||||
String? avatar;
|
||||
|
||||
/// 饭卡状态
|
||||
String? cardStatus;
|
||||
|
||||
/// 编号
|
||||
String? id;
|
||||
|
||||
/// 部门名
|
||||
String? deptId;
|
||||
|
||||
/// 部门名
|
||||
String? deptName;
|
||||
|
||||
/// 用户编号
|
||||
String? userId;
|
||||
|
||||
/// 饭卡类型Id
|
||||
String? walletTypeId;
|
||||
|
||||
/// 饭卡类型
|
||||
String? walletTypeUniqueCode;
|
||||
|
||||
/// 饭卡图标
|
||||
String? walletTypeIcon;
|
||||
|
||||
/// 用户卡号
|
||||
String? cardNumber;
|
||||
|
||||
/// 钱包编号
|
||||
String? walletId;
|
||||
|
||||
/// 是否激活
|
||||
@JsonKey(fromJson: JsonTool.stringToBoolean, toJson: JsonTool.booleanToString)
|
||||
bool? isActiveHardware;
|
||||
|
||||
ServiceOpenCard({
|
||||
this.username,
|
||||
this.mobile,
|
||||
this.avatar,
|
||||
this.cardStatus,
|
||||
this.id,
|
||||
this.deptId,
|
||||
this.deptName,
|
||||
this.userId,
|
||||
this.walletTypeId,
|
||||
this.walletTypeUniqueCode,
|
||||
this.walletTypeIcon,
|
||||
this.cardNumber,
|
||||
this.walletId,
|
||||
this.isActiveHardware,
|
||||
});
|
||||
|
||||
factory ServiceOpenCard.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceOpenCardFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ServiceOpenCardToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class ServiceOpenCardPage extends ServicePageBase {
|
||||
List<ServiceOpenCard>? records;
|
||||
|
||||
ServiceOpenCardPage({
|
||||
this.records,
|
||||
});
|
||||
|
||||
factory ServiceOpenCardPage.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceOpenCardPageFromJson(
|
||||
json,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ServiceOpenCardPageToJson(this);
|
||||
}
|
||||
@@ -118,3 +118,75 @@ Map<String, dynamic> _$ServiceQRCodeToJson(ServiceQRCode instance) =>
|
||||
'exceedTime': instance.exceedTime,
|
||||
'extra': instance.extra,
|
||||
};
|
||||
|
||||
ServiceHardOrder _$ServiceHardOrderFromJson(Map<String, dynamic> json) =>
|
||||
ServiceHardOrder(
|
||||
username: json['username'] as String?,
|
||||
userMobile: json['userMobile'] as String?,
|
||||
userAvatar: json['userAvatar'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceHardOrderToJson(ServiceHardOrder instance) =>
|
||||
<String, dynamic>{
|
||||
'username': instance.username,
|
||||
'userMobile': instance.userMobile,
|
||||
'userAvatar': instance.userAvatar,
|
||||
};
|
||||
|
||||
ServiceOpenCard _$ServiceOpenCardFromJson(Map<String, dynamic> json) =>
|
||||
ServiceOpenCard(
|
||||
username: json['username'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
avatar: json['avatar'] as String?,
|
||||
cardStatus: json['cardStatus'] as String?,
|
||||
id: json['id'] as String?,
|
||||
deptId: json['deptId'] as String?,
|
||||
deptName: json['deptName'] as String?,
|
||||
userId: json['userId'] as String?,
|
||||
walletTypeId: json['walletTypeId'] as String?,
|
||||
walletTypeUniqueCode: json['walletTypeUniqueCode'] as String?,
|
||||
walletTypeIcon: json['walletTypeIcon'] as String?,
|
||||
cardNumber: json['cardNumber'] as String?,
|
||||
walletId: json['walletId'] as String?,
|
||||
isActiveHardware:
|
||||
JsonTool.stringToBoolean(json['isActiveHardware'] as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceOpenCardToJson(ServiceOpenCard instance) =>
|
||||
<String, dynamic>{
|
||||
'username': instance.username,
|
||||
'mobile': instance.mobile,
|
||||
'avatar': instance.avatar,
|
||||
'cardStatus': instance.cardStatus,
|
||||
'id': instance.id,
|
||||
'deptId': instance.deptId,
|
||||
'deptName': instance.deptName,
|
||||
'userId': instance.userId,
|
||||
'walletTypeId': instance.walletTypeId,
|
||||
'walletTypeUniqueCode': instance.walletTypeUniqueCode,
|
||||
'walletTypeIcon': instance.walletTypeIcon,
|
||||
'cardNumber': instance.cardNumber,
|
||||
'walletId': instance.walletId,
|
||||
'isActiveHardware': JsonTool.booleanToString(instance.isActiveHardware),
|
||||
};
|
||||
|
||||
ServiceOpenCardPage _$ServiceOpenCardPageFromJson(Map<String, dynamic> json) =>
|
||||
ServiceOpenCardPage(
|
||||
records: (json['records'] as List<dynamic>?)
|
||||
?.map((e) => ServiceOpenCard.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
)
|
||||
..current = (json['current'] as num).toInt()
|
||||
..pages = (json['pages'] as num).toInt()
|
||||
..size = (json['size'] as num).toInt()
|
||||
..total = (json['total'] as num).toInt();
|
||||
|
||||
Map<String, dynamic> _$ServiceOpenCardPageToJson(
|
||||
ServiceOpenCardPage instance) =>
|
||||
<String, dynamic>{
|
||||
'current': instance.current,
|
||||
'pages': instance.pages,
|
||||
'size': instance.size,
|
||||
'total': instance.total,
|
||||
'records': instance.records,
|
||||
};
|
||||
Reference in new issue
Block a user