mobile_skt/lib/models/dict_item.model.dart

54 lines
1.2 KiB
Dart
Raw Permalink Normal View History

2024-10-16 09:48:17 +08:00
class DictItemModel {
DictItemModel({
this.id,
this.createdAt,
this.updatedAt,
this.creator,
this.updater,
required this.label,
this.value,
this.orderNo,
this.status,
this.remark,
});
final int? id;
final DateTime? createdAt;
final DateTime? updatedAt;
final String? creator;
final String? updater;
final String label;
final String? value;
final int? orderNo;
final int? status;
final String? remark;
factory DictItemModel.fromJson(Map<String, dynamic> json) {
return DictItemModel(
id: json["id"],
createdAt: DateTime.tryParse(json["createdAt"] ?? ""),
updatedAt: DateTime.tryParse(json["updatedAt"] ?? ""),
creator: json["creator"],
updater: json["updater"],
label: json["label"],
value: json["value"],
orderNo: json["orderNo"],
status: json["status"],
remark: json["remark"],
);
}
Map<String, dynamic> toJson() => {
"id": id,
"createdAt": createdAt?.toIso8601String(),
"updatedAt": updatedAt?.toIso8601String(),
"creator": creator,
"updater": updater,
"label": label,
"value": value,
"orderNo": orderNo,
"status": status,
"remark": remark,
};
}