import Foundation /// 后端只给 task_key / biz_type,前端做中文文案映射。任务现仅 enable_notification。 enum WelfareCatalog { static func taskTitle(_ key: String) -> String { switch key { case "enable_notification": return "开启推送通知" default: return key } } static func taskDesc(_ key: String) -> String { switch key { case "enable_notification": return "接收降价提醒与省钱攻略" default: return "" } } /// 金币流水的业务文案:remark 优先,否则按 biz_type 映射。 static func coinBizText(_ tx: CoinTransactionDTO) -> String { if let remark = tx.remark, !remark.isEmpty { return remark } switch tx.bizType { case "signin": return "每日签到" case "ad_reward": return "看广告奖励" case "exchange": return "兑换现金" default: return tx.bizType.hasPrefix("task_") ? "任务奖励" : tx.bizType } } }