/// 枚举定义：所有通知的二级类型
enum NotifyMessageType {
  newFocus, //新的关注
  systemNotify, // 系统->通知
  systemReport, // 系统->举报下架（视频，视频评论）
  systemCheck, // 系统->审核结果（复审，驳回 ，通过）
  systemPush, //系统->推广类的
  interactionComment, //互动->评论
  interactionAt, //互动->视频评论中的@
  interactionLike, //互动->点赞
  interactionReply, //互动->评论回复
  orderRecharge, //订单->充值 online
  orderPay, //订单->订单交易成功通知 online
  orderRefund, //订单->退款结果通知
  orderWithDraw, //订单->提现成功通知
  groupNotifyCheck, //群通知->进群申请 online
  groupNotifyAccpet, // 群通知->进群审核审核通过 online
  groupNotifyFail, // 群通知->进群审核审核拒绝 online
  groupNotifyLeaveUp, // 群通知->群升级为达人群通知
}

/// 常量映射
class NotifyMessageTypeConstants {
  static const String newFocus = 'newFocus';
  static const String systemNotify = 'systemNotify';
  static const String systemReport = 'systemReport';
  static const String systemCheck = 'systemCheck';
  static const String systemPush = 'systemPush';
  static const String interactionComment = 'interactionComment';
  static const String interactionAt = 'interactionAt';
  static const String interactionLike = 'interactionLike';
  static const String interactionReply = 'interactionReply';
  static const String orderRecharge = 'orderRecharge';
  static const String orderPay = 'orderPay';
  static const String orderRefund = 'orderRefund';
  static const String orderWithDraw = 'orderWithDraw';
  static const String groupNotifyCheck = 'groupNotifyCheck';
  static const String groupNotifyAccpet = 'groupNotifyAccpet';
  static const String groupNotifyFail = 'groupNotifyFail';
  static const String groupNotifyLeaveUp = 'groupNotifyLeaveUp';
}

extension NotifyMessageTypeExtension on NotifyMessageType {
  String get name {
    switch (this) {
      case NotifyMessageType.newFocus:
        return 'newFocus';
      case NotifyMessageType.systemNotify:
        return 'systemNotify';
      case NotifyMessageType.systemReport:
        return 'systemReport';
      case NotifyMessageType.systemCheck:
        return 'systemCheck';
      case NotifyMessageType.systemPush:
        return 'systemPush';
      case NotifyMessageType.interactionComment:
        return 'interactionComment';
      case NotifyMessageType.interactionAt:
        return 'interactionAt';
      case NotifyMessageType.interactionLike:
        return 'interactionLike';
      case NotifyMessageType.interactionReply:
        return 'interactionReply';
      case NotifyMessageType.orderRecharge:
        return 'orderRecharge';
      case NotifyMessageType.orderPay:
        return 'orderPay';
      case NotifyMessageType.orderWithDraw:
        return 'orderWithDraw';
      case NotifyMessageType.orderRefund:
        return 'orderRefund';
      case NotifyMessageType.groupNotifyCheck:
        return 'groupNotifyCheck';
      case NotifyMessageType.groupNotifyAccpet:
        return 'groupNotifyAccpet';
      case NotifyMessageType.groupNotifyFail:
        return 'groupNotifyFail';
      case NotifyMessageType.groupNotifyLeaveUp:
        return 'groupNotifyLeaveUp';
    }
  }
}

notifyMessageTypeFromString(String? type) {
  switch (type) {
    case 'newFocus':
      return NotifyMessageType.newFocus.name;
    case 'systemNotify':
      return NotifyMessageType.systemNotify.name;
    case 'systemReport':
      return NotifyMessageType.systemReport.name;
    case 'systemCheck':
      return NotifyMessageType.systemCheck.name;
    case 'systemPush':
      return NotifyMessageType.systemPush.name;
    case 'interactionComment':
      return NotifyMessageType.interactionComment.name;
    case 'interactionAt':
      return NotifyMessageType.interactionAt.name;
    case 'interactionLike':
      return NotifyMessageType.interactionLike.name;
    case 'interactionReply':
      return NotifyMessageType.interactionReply.name;
    case 'orderRecharge':
      return NotifyMessageType.orderRecharge.name;
    case 'orderPay':
      return NotifyMessageType.orderPay.name;
    case 'orderWithDraw':
      return NotifyMessageType.orderWithDraw.name;
    case 'orderRefund':
      return NotifyMessageType.orderRefund.name;
    case 'groupNotifyCheck':
      return NotifyMessageType.groupNotifyCheck.name;
    case 'groupNotifyAccpet':
      return NotifyMessageType.groupNotifyAccpet.name;
    case 'groupNotifyFail':
      return NotifyMessageType.groupNotifyFail.name;
    case 'groupNotifyLeaveUp':
      return NotifyMessageType.groupNotifyLeaveUp.name;
    default:
      return null;
  }
}
