KMAdvertisementModel.swift 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. //
  2. // KMAdvertisementModel.swift
  3. // KMAdvertisement
  4. //
  5. // Created by lizhe on 2022/11/30.
  6. //
  7. @objcMembers public class KMAdvertisementInfo: NSObject, Codable {
  8. public var recommondContent: KMAdvertisementContent?
  9. public var advertisement: KMAdvertisementItem?
  10. public var remoteControl: KMAdvertisementRemoteControl?
  11. public var discountContent: KMAdvertisementItem?
  12. public var popWindowContent: KMAdvertisementItem?
  13. }
  14. @objcMembers public class KMAdvertisementContent: NSObject, Codable {
  15. public var recommondContentOther: KMAdvertisementItem?
  16. public var recommondContentPDFPro: KMAdvertisementItem?
  17. }
  18. @objcMembers public class KMAdvertisementItem: NSObject, Codable {
  19. public var version: String?
  20. public var name: Language?
  21. public var content: [KMAdvertisementItemInfo]?
  22. }
  23. @objcMembers public class KMAdvertisementRemoteControl: NSObject, Codable {
  24. var showMenuHelpInfo: String?
  25. }
  26. @objcMembers public class KMAdvertisementItemInfo: NSObject, Codable {
  27. var index: Int?
  28. var show: String? //是否显示,内部有做了时间区间判断
  29. var subscriptionType: String? //类型
  30. var showType: KMAdvertisementShowType?
  31. var startTime: String?
  32. var endTime: String?
  33. var version: String? //版本号,唯一标识符
  34. var showCloseBtn: String? //是否显示关闭按钮,(左下角广告需要)
  35. var image: Image? //APP互推,常规状态下的图片
  36. var iconImage: String? //广告显示图片(自适应多语)
  37. var name: Language? //名称(自适应多语)
  38. var tooltip: Language? //提示语(自适应多语)
  39. var linkURL: Language? //跳转链接(自适应多语)
  40. var subTitle: Language? //名称(自适应多语)
  41. var otherTitle: Language? //名称(自适应多语)
  42. var btnTitle: Language? //名称(自适应多语)
  43. //Firebase
  44. var firebase: firebaseInfo?
  45. var firebaseEvent: String?
  46. var firebasePropertyKey: String?
  47. var firebasePropertyValue: String?
  48. public class Image: NSObject, Codable {
  49. public let zh_TW: String?
  50. public let hover_Dark: String?
  51. public let hover_Light: String?
  52. public let zh_CN: String?
  53. public let normal_Light: String?
  54. public let normal_Dark: String?
  55. public let en: String?
  56. }
  57. }
  58. public class firebaseInfo: NSObject, Codable {
  59. var event: String?
  60. var propertyKey: String?
  61. var propertyValue: String?
  62. }
  63. public class Language: NSObject, Codable {
  64. var en: String?
  65. var zh_TW: String?
  66. var zh_CN: String?
  67. }
  68. //@objcMembers public class KMAdvertisementModel: NSObject, Codable {
  69. // public var appName: KMAdvertisementAppNameType = .FilmageEditorMac //产品名
  70. // public var platform: KMAdvertisementPlatformType = .Mac //平台
  71. // public var showType: KMAdvertisementShowType = .view //显示类型
  72. // public let startTime: String? //开始时间 时间戳
  73. // public let endTime: String? //结束时间 时间戳
  74. // public let version: String? //小于等于此版本生效
  75. // public let hidden: Bool? //是否显示
  76. // let subscribeType: KMAdvertisementSubscribeType? //是否订阅
  77. // public var content: [KMAdvertisementModelSection]?
  78. //}
  79. //
  80. //@objcMembers public class KMAdvertisementModelSection: NSObject, Codable {
  81. // public let sectionTitle: KMAdvertisementModelItem.Text?
  82. // public var content: [KMAdvertisementModelItem]?
  83. //}
  84. //
  85. //@objcMembers public class KMAdvertisementModelItem: NSObject, Codable {
  86. // public var productID: String?
  87. // public let startTime: String? //开始时间 时间戳
  88. // public let endTime: String? //结束时间 时间戳
  89. // public var hidden: Bool?
  90. //
  91. // public var index: Int?
  92. // public let title: Text?
  93. // public let imageURL: Image?
  94. // public let ipadImageURL: Image?
  95. // public let linkURL: Language?
  96. // public let tips: Language?
  97. // public let button: Text?
  98. // public var actionType: KMAdvertisementActionType = .URL
  99. //
  100. // public struct Text: Codable {
  101. // public let font: Font?
  102. // public let color: Color?
  103. // public let background: Background?
  104. // public let language: Language?
  105. // }
  106. //
  107. // public struct Font: Codable {
  108. // public let name: String?
  109. // public let size: Int?
  110. // }
  111. //
  112. // public struct Color: Codable {
  113. // let height: ColorState?
  114. // let normal: ColorState?
  115. //
  116. // struct ColorState: Codable {
  117. // public let dark: ColorInfo?
  118. // public let universal: ColorInfo?
  119. //
  120. // struct ColorInfo: Codable {
  121. // public var hex: String?
  122. // public var alpha: Float?
  123. // }
  124. // }
  125. // }
  126. //
  127. // public struct Background: Codable {
  128. // let color: Color?
  129. // let layer: Layer?
  130. //
  131. // struct Layer: Codable {
  132. // public let cornerRadius: CGFloat?
  133. // public let borderWidth: CGFloat?
  134. // public let borderColor: Color?
  135. // }
  136. // }
  137. //
  138. // public struct Image: Codable {
  139. // public let height: ImageInfo?
  140. // public let normal: ImageInfo?
  141. // public let background: Background?
  142. // }
  143. //
  144. // public struct ImageInfo: Codable {
  145. // public let dark: Language?
  146. // public let universal: Language?
  147. // }
  148. //
  149. // public class Language: NSObject, Codable {
  150. // public let en: String?
  151. // public let zh_TW: String?
  152. // public let zh_CN: String?
  153. // }
  154. //}