123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208 |
- //
- // KMMemberProductResult.swift
- // PDF Reader Pro
- //
- // Created by wanjun on 2024/11/4.
- //
- import Cocoa
- class KMMemberProductResult: NSObject {
- var code : Int?
- var msg : String?
- var result : String?
- var result_Bool : Bool?
- var result_Dict : Bool?
-
- var listingProducts : [KMListingProductsModel]? // 上架中的产品
- var batchProductPrice : KMBatchProductPriceModel? // 批量阶段购买价格
- var checkCoupon : KMCheckCouponModel? // 商品优惠券
- var createOrder : KMCreateOrderModel? // 创建订单(买断、订阅)
-
- /**
- @abstract 通用返回字符串
- @param code
- @param msg
- @param result
- */
- init(code: Int, msg: String, result: String) {
- self.code = code
- self.msg = msg
- self.result = result
- }
-
- /**
- @abstract 获取上架中的产品
- @param code
- @param msg
- @param listingProducts
- */
- init(code: Int, msg: String, listingProducts: [KMListingProductsModel]) {
- self.code = code
- self.msg = msg
- self.listingProducts = listingProducts
- }
-
- /**
- @abstract 批量阶段购买价格
- @param code
- @param msg
- @param batchProductPrice
- */
- init(code: Int, msg: String, batchProductPrice: KMBatchProductPriceModel) {
- self.code = code
- self.msg = msg
- self.batchProductPrice = batchProductPrice
- }
-
- /**
- @abstract 商品优惠
- @param code
- @param msg
- @param checkCoupon
- */
- init(code: Int, msg: String, checkCoupon: KMCheckCouponModel) {
- self.code = code
- self.msg = msg
- self.checkCoupon = checkCoupon
- }
-
- /**
- @abstract 创建订单(买断、订阅)
- @param code
- @param msg
- @param createOrder
- */
- init(code: Int, msg: String, createOrder: KMCreateOrderModel) {
- self.code = code
- self.msg = msg
- self.createOrder = createOrder
- }
- }
- class KMListingProductsModel: NSObject {
- var id : String = "" // 【可选】id
- var productName : String = "" // 【可选】名称
- var price : NSNumber = NSNumber(value: 0.0) // 【可选】价格
- var maxDeviceNum : Int = 0 // 【可选】最大可登录设备数
- var levels : String = "" // 【可选】3高级2标准1免费
- var platforms : String = "" // 【可选】产品支持平台
- var productLineId : Int = 0 // 【可选】所属业务线id (1pdf产品线2compdfkit产品线)
- var paymentModel : Int = 0 // 【可选】付费模式(1自动续订 2单次付费)
- var cycle : Int = 0 // 【可选】订阅周期:1、月(30天);2、季(90天);3、半年(183天);4、年(365天)
- var code : String = "" // 【可选】产品code
- var cnyPrice : NSNumber = NSNumber(value: 0.0) // 【可选】人民币价格
- // var displayCnyPrice : NSNull // 【可选】人民币优惠价格
- // var displayPrice : NSNull // 【可选】教育优惠价格
- // var upgradePrice : NSNull // 【可选】买断升级订阅价格
- init(id: String, productName: String, price: NSNumber, maxDeviceNum: Int, levels: String, platforms: String, productLineId: Int, paymentModel: Int, cycle: Int, code: String, cnyPrice: NSNumber) {
- self.id = id
- self.productName = productName
- self.price = price
- self.maxDeviceNum = maxDeviceNum
- self.levels = levels
- self.platforms = platforms
- self.productLineId = productLineId
- self.paymentModel = paymentModel
- self.cycle = cycle
- self.code = code
- self.cnyPrice = cnyPrice
- }
- }
- class KMBatchProductPriceModel: NSObject {
- var productId : String = "" // 【必需】产品id
- var totalPrice : String = "" // 【必需】总价
- var price : String = "" // 【必需】总价
- var batchPrice : String = "" // 【必需】批量购买优惠后单价
- var cnyPrice : String = "" // 【必需】人民币单价
- var cnyBatchPrice : String = "" // 【必需】批量购买优惠后人民币单价
- var cnyTotalPrice : String = "" // 【必需】cnyTotalPrice
- init(productId: String, totalPrice: String, price: String, batchPrice: String, cnyPrice: String, cnyBatchPrice: String, cnyTotalPrice: String) {
- self.productId = productId
- self.totalPrice = totalPrice
- self.price = price
- self.batchPrice = batchPrice
- self.cnyPrice = cnyPrice
- self.cnyBatchPrice = cnyBatchPrice
- self.cnyTotalPrice = cnyTotalPrice
- }
- }
- class KMCheckCouponModel: NSObject {
- var id : String = "" // 【必需】id
- var productName : String = "" // 【必需】名称
- var price : String = "" // 【必需】价格
- var maxDeviceNum : Int = 0 // 【必需】最大可登录设备数
- var displayPrice : String = "" // 【必需】优惠后价格
- var levels : String = "" // 【必需】3高级2标准1免费
- var platforms : String = "" // 【必需】产品支持平台
- var productLineId : Int = 0 // 【必需】所属业务线id (1pdf产品线2compdfkit产品线)
- var paymentModel : Int = 0 // 【必需】付费模式(1自动续订 2单次付费)
- var cycle : Int = 0 // 【必需】订阅周期:1、月(30天);2、季(90天);3、半年(183天);4、年(365天)
- var cnyPrice : String = "" // 【必需】人民币价格
- var displayCnyPrice : String = "" // 【必需】人民币优惠价格
- init(id: String, productName: String, price: String, maxDeviceNum: Int, displayPrice: String, levels: String, platforms: String, productLineId: Int, paymentModel: Int, cycle: Int, cnyPrice: String, displayCnyPrice: String) {
- self.id = id
- self.productName = productName
- self.price = price
- self.maxDeviceNum = maxDeviceNum
- self.displayPrice = displayPrice
- self.levels = levels
- self.platforms = platforms
- self.productLineId = productLineId
- self.paymentModel = paymentModel
- self.cycle = cycle
- self.cnyPrice = cnyPrice
- self.displayCnyPrice = displayCnyPrice
- }
- }
- /**
- 创建 买断/订阅 订单数据模型
- */
- class KMCreateOrderModel: NSObject {
- var thirdOrderNo : String = "" // 【必需】
- var orderId : String = "" // 【必需】
- var payHref : String = "" // 【必需】
- init(thirdOrderNo: String, orderId: String, payHref: String) {
- self.thirdOrderNo = thirdOrderNo
- self.orderId = orderId
- self.payHref = payHref
- }
- }
- /**
- 获取订单列表
- */
- class KMOrderListModel: NSObject {
- var id : String = ""
- var appId : String = ""
- var subscriptionId : String = ""
- var tradeNo : String = ""
- var thirdOrderNo : String = ""
- var price : Int = 0
- var payment : Int = 0
- var status : Int = 0
- var createdAt : String = ""
- var updatedAt : String = ""
- var result : String = ""
- var pagePayUrl : String = ""
- var invoiceNo : String = ""
- var thirdTradeNo : String = ""
- var productId : String = ""
- var discount : String = ""
- var reducedPrice : String = ""
- var isVpp : String = ""
- var type : Int = 0
- var detailType : String = ""
- var userId : String = ""
- var email : String = ""
- var payNumber : Int = 0
- var isEducation : Int = 0
- var subscriptionType : Int = 0
- var paymentModel : Int = 0
-
- }
|