提交预约,相关修改
This commit is contained in:
26
ln_jq_app/lib/common/model/station_model.dart
Normal file
26
ln_jq_app/lib/common/model/station_model.dart
Normal file
@@ -0,0 +1,26 @@
|
||||
class StationModel {
|
||||
final String hydrogenId;
|
||||
final String name;
|
||||
final String address;
|
||||
final String price;
|
||||
final String siteStatusName; // 例如 "维修中"
|
||||
|
||||
StationModel({
|
||||
required this.hydrogenId,
|
||||
required this.name,
|
||||
required this.address,
|
||||
required this.price,
|
||||
required this.siteStatusName,
|
||||
});
|
||||
|
||||
// 从 JSON map 创建对象的工厂构造函数
|
||||
factory StationModel.fromJson(Map<String, dynamic> json) {
|
||||
return StationModel(
|
||||
hydrogenId: json['hydrogenId'] ?? '',
|
||||
name: json['name'] ?? '未知站点',
|
||||
address: json['address'] ?? '地址未知',
|
||||
price: json['price']?.toString() ?? '0.00',
|
||||
siteStatusName: json['siteStatusName'] ?? '',
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user