ThimraTV/MoviaBox/Class/Wallet/Model/SPPayTemplateItem.swift
2025-06-18 19:26:21 +08:00

103 lines
2.3 KiB
Swift

//
// SPPayTemplateItem.swift
// MoviaBox
//
// Created by on 2025/4/28.
//
import UIKit
import SmartCodable
class SPPayTemplateItem: SPModel, SmartCodable {
enum BuyType: String, SmartCaseDefaultable {
case coins = "coins"
case subVip = "sub_vip"
}
enum SizeType: String, SmartCaseDefaultable {
case small
case big
}
enum VipTypeKey: String, SmartCaseDefaultable {
case week = "week"
case month = "month"
case quarter = "quarter"
case year = "year"
func getText() -> String {
switch self {
case .week:
return "w_complex".localized
case .month:
return "m_complex".localized
case .quarter:
return "q_complex".localized
case .year:
return "Y_complex".localized
}
}
func getTextV2() -> String {
switch self {
case .week:
return "week_short_type".localized
case .month:
return "month_short_type".localized
case .quarter:
return "quarter_short_type".localized
case .year:
return "year_short_type".localized
}
}
}
var id: String?
var status: String?
var price: String?
var origin_price: String?
var backhaul_price: String?
var coins: Int?
var send_coins: Int?
///coins sub_vip
var buy_type: BuyType?
var sort: String?
var title: String?
var brief: String?
var sp_description: String?
var send_coin_ttl: Int?
var vip_type: String?
var vip_type_key: VipTypeKey?
var size: SizeType?
var ios_template_id: String?
///
var currency: String?
///
var platform: String?
///
var corner_marker: String?
static func mappingForKey() -> [SmartKeyTransformer]? {
return [
CodingKeys.sp_description <--- ["description"]
]
}
}