class StationModel {
  final String hydrogenId;
  final String name;
  final String address;
  final String price;
  final String siteStatusName; // 例如 "维修中"
  final int isSelect; // 1是可用 0是不可用
  final String startBusiness; // 新增：可预约最早开始时间，如 "06:00:00"
  final String endBusiness;   // 新增：可预约最晚结束时间，如 "22:00:00"

  StationModel({
    required this.hydrogenId,
    required this.name,
    required this.address,
    required this.price,
    required this.siteStatusName,
    required this.isSelect,
    required this.startBusiness,
    required this.endBusiness,
  });

  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'] ?? '',
      isSelect: json['isSelect'] as int? ?? 0,
      startBusiness: json['startBusiness'] ?? '00:00:00', // 默认全天
      endBusiness: json['endBusiness'] ?? '23:59:59',     // 默认全天
    );
  }
}
