회원목록

This commit is contained in:
2025-08-01 16:45:26 +09:00
parent a996def67a
commit ed8c7eacba
191 changed files with 17491 additions and 0 deletions
+77
View File
@@ -0,0 +1,77 @@
class Club {
final String id;
final String name;
final String? description;
final String? logo;
final String? address;
final String? location;
final String? phone;
final String? email;
final String? website;
final int? memberCount;
final String? ownerId;
final int? femaleHandicap;
final String? averageCalculationPeriod;
final DateTime? createdAt;
final DateTime? updatedAt;
Club({
required this.id,
required this.name,
this.description,
this.logo,
this.address,
this.location,
this.phone,
this.email,
this.website,
this.memberCount,
this.ownerId,
this.femaleHandicap,
this.averageCalculationPeriod,
this.createdAt,
this.updatedAt,
});
// JSON 데이터로부터 Club 객체 생성
factory Club.fromJson(Map<String, dynamic> json) {
return Club(
id: json['id'] != null ? json['id'].toString() : '',
name: json['name'] ?? '',
description: json['description'],
logo: json['logo'],
address: json['address'],
location: json['location'],
phone: json['phone'] ?? json['contact'], // contact 필드도 확인
email: json['email'],
website: json['website'],
memberCount: json['memberCount'],
ownerId: json['ownerId']?.toString(),
femaleHandicap: json['femaleHandicap'] != null ? int.tryParse(json['femaleHandicap'].toString()) : null,
averageCalculationPeriod: json['averageCalculationPeriod'],
createdAt: json['createdAt'] != null ? DateTime.parse(json['createdAt']) : null,
updatedAt: json['updatedAt'] != null ? DateTime.parse(json['updatedAt']) : null,
);
}
// Club 객체를 JSON으로 변환
Map<String, dynamic> toJson() {
return {
'id': id,
'name': name,
'description': description,
'logo': logo,
'address': address,
'location': location,
'phone': phone,
'email': email,
'website': website,
'memberCount': memberCount,
'ownerId': ownerId,
'femaleHandicap': femaleHandicap,
'averageCalculationPeriod': averageCalculationPeriod,
'createdAt': createdAt?.toIso8601String(),
'updatedAt': updatedAt?.toIso8601String(),
};
}
}