/// 首页 Banner 数据模型
class ActivityBanner {
  final int id;
  final String title;
  final String imageUrl;
  final String linkType; // "internal" | "external"
  final String linkUrl;
  final int sort;

  const ActivityBanner({
    this.id = 0,
    required this.title,
    this.imageUrl = '',
    this.linkType = 'internal',
    this.linkUrl = '',
    this.sort = 0,
  });

  factory ActivityBanner.fromJson(Map<String, dynamic> json) {
    return ActivityBanner(
      id: json['id'] as int? ?? 0,
      title: json['title'] as String? ?? '',
      imageUrl: json['imageUrl'] as String? ?? '',
      linkType: json['linkType'] as String? ?? 'internal',
      linkUrl: json['linkUrl'] as String? ?? '',
      sort: json['sort'] as int? ?? 0,
    );
  }

  bool get isExternal => linkType == 'external';
}
