KMMemberCenterResult.swift 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. //
  2. // KMMemberCenterResult.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by wanjun on 2024/10/21.
  6. //
  7. import Cocoa
  8. class KMMemberCenterResult: NSObject {
  9. var code : Int?
  10. var msg : String?
  11. var result : Bool?
  12. var login_Result : KMMemberLoginResult? // 登录
  13. var deviceList_Result : [KMMemberDeviceList]? // 设备列表
  14. var maxDeviceNum : Int? // 设备限制数
  15. var resultStr : String?
  16. var resultInt : Int?
  17. var userInfo : KMMemberUserInfo? //用户信息
  18. var activeVIPs : [KMMemberUserInfoActiveVIP]? // 当前会员状况
  19. var logOff: KMMemberLogOff? // 手动注销
  20. /**
  21. @abstract 新会员系统重置密码 & 验证邮箱(重置密码) & 获取邮箱验证码 & 实时检查邮件验证码
  22. @param code
  23. @param msg
  24. @param result
  25. */
  26. init(code: Int, msg: String, result: Bool) {
  27. self.code = code
  28. self.msg = msg
  29. self.result = result
  30. }
  31. // 邮箱登录
  32. /**
  33. @abstract 邮箱登录
  34. @param code
  35. @param msg
  36. @param result
  37. */
  38. init(loginResult: KMMemberLoginResult) {
  39. self.login_Result = loginResult
  40. }
  41. // 登出用户的指定设备
  42. init(code: Int, msg: String, resultStr: String) {
  43. self.code = code
  44. self.msg = msg
  45. self.resultStr = resultStr
  46. }
  47. // 老带新已邀请人数
  48. init(code: Int, msg: String, resultInt: Int) {
  49. self.code = code
  50. self.msg = msg
  51. self.resultInt = resultInt
  52. }
  53. // 获取用户登录设备列表
  54. init(deviceListResult: [KMMemberDeviceList], maxDeviceNum: Int) {
  55. self.deviceList_Result = deviceListResult
  56. self.maxDeviceNum = maxDeviceNum
  57. }
  58. /**
  59. @abstract 获取用户个人信息
  60. @param complete 回调
  61. */
  62. init(code: Int, msg: String, userInfo: KMMemberUserInfo) {
  63. self.code = code
  64. self.msg = msg
  65. self.userInfo = userInfo
  66. }
  67. /**
  68. @abstract 获取用户当前的会员情况
  69. @param code 返回值
  70. @param msg 返回信息
  71. @param activeVIPs 用户当前的会员情况
  72. */
  73. init(code: Int, msg: String, activeVIPs: [KMMemberUserInfoActiveVIP]) {
  74. self.code = code
  75. self.msg = msg
  76. self.activeVIPs = activeVIPs
  77. }
  78. /**
  79. @abstract 用户手动注销
  80. @param code 返回值
  81. @param msg 返回信息
  82. @param logOff 手动注销时间
  83. */
  84. init(code: Int, msg: String, logOff: KMMemberLogOff) {
  85. self.code = code
  86. self.msg = msg
  87. self.logOff = logOff
  88. }
  89. }
  90. class KMMemberLoginResult: NSObject {
  91. var refreshToken : String?
  92. var accessToken : String?
  93. var tokenType : String?
  94. var expiresIn : String?
  95. var scope : String?
  96. init(refreshToken: String, accessToken: String, tokenType: String, expiresIn: String, scope: String = "") {
  97. self.refreshToken = refreshToken
  98. self.accessToken = accessToken
  99. self.tokenType = tokenType
  100. self.expiresIn = expiresIn
  101. self.scope = scope
  102. }
  103. }
  104. class KMMemberDeviceList: NSObject {
  105. var id: String? // 解绑时需要
  106. var deviceId: String? // 设备Id
  107. var productId: String? // 产品Id
  108. var uniqueSn: String? // 设备唯一标识
  109. var appId: String? // appId
  110. var userId: String?
  111. var device_model: String?
  112. var device_os: String?
  113. var deviceName: String?
  114. var language: String?
  115. var timeZone: String?
  116. var appVersion: String?
  117. var platform: String?
  118. var updatedAt: String?
  119. var createdAt: String?
  120. var validFlag: String?
  121. init(deviceId: String?, productId: String?, uniqueSn: String?, appId: String?, userId: String? = "", device_model: String? = "", device_os: String? = "", deviceName: String? = "", language: String? = "", timeZone: String? = "", appVersion: String? = "", platform: String? = "", updatedAt: String? = "", createdAt: String? = "", validFlag: String? = "") {
  122. self.deviceId = deviceId
  123. self.productId = productId
  124. self.uniqueSn = uniqueSn
  125. self.appId = appId
  126. self.userId = userId
  127. self.device_model = device_model
  128. self.device_os = device_os
  129. self.deviceName = deviceName
  130. self.language = language
  131. self.timeZone = timeZone
  132. self.appVersion = appVersion
  133. self.platform = platform
  134. self.updatedAt = updatedAt
  135. self.createdAt = createdAt
  136. self.validFlag = validFlag
  137. }
  138. }
  139. class KMMemberUserInfo: NSObject {
  140. var id : String = "" // 【必需】用户id
  141. var email : String = "" // 【必需】邮箱
  142. var fullName : String = "" // 【必需】名称
  143. var activeVIP : [KMMemberUserInfoActiveVIP] = [] // 【必需】活跃的会员
  144. var activeAI : [KMMemberUserInfoActiveVIP] = [] // 【必需】活跃的AI
  145. var aiPoint : Int = 0 // 【必需】ai点数
  146. var validFlag : String = "" // 【必需】注销(0), * 正常(1), * 停用(2), * 注销中(5);
  147. // var isHavePwd : String = "" // 【必需】1是0否 是否设置了密码
  148. var isHaveAIDiscount: String = "" // 【必需】1是0否 是否有ai折扣
  149. var canTrail : String = "" // 【必需】1是0否 是否能试用
  150. init(id: String = "", email: String = "", fullName: String = "", activeVIP: [KMMemberUserInfoActiveVIP] = [], activeAI: [KMMemberUserInfoActiveVIP] = [], aiPoint: Int = 0, validFlag: String = ""/*, isHavePwd: String = ""*/, isHaveAIDiscount: String = "", canTrail: String = "") {
  151. self.id = id
  152. self.email = email
  153. self.fullName = fullName
  154. self.activeVIP = activeVIP
  155. self.activeAI = activeAI
  156. self.aiPoint = aiPoint
  157. self.validFlag = validFlag
  158. // self.isHavePwd = isHavePwd
  159. self.isHaveAIDiscount = isHaveAIDiscount
  160. self.canTrail = canTrail
  161. }
  162. }
  163. class KMMemberUserInfoActiveVIP: NSObject {
  164. var id : String = "" // 【可选】id
  165. var userId : String = "" // 【可选】用户id
  166. var status : Int = 0 // 【可选】状态 0注册1订阅中2订阅过期3试用中4试用过期
  167. var endDate : String = "" // 【可选】到期时间
  168. var payType : Int = 0 // 【可选】0未开启自动续订 1自动续订
  169. var productName : String = "" // 【可选】产品名字
  170. var levels : String = "" // 【可选】会员等级 1是免费 2是标准 3是高级
  171. var platforms : String = "" // 【可选】支持的平台
  172. var point : Int = 0 // 【可选】剩余ai点数(svip才有)
  173. var maxDeviceNum : Int = 0 // 【可选】最大登录设备限制数
  174. var paymentModel : String = "" // 【可选】支付方式 付费模式(1自动续订(vip svip) 2单次付费(永久会员))
  175. var isAi : String = "" // 【可选】是否是ai产品(0否1是)
  176. var cycle : Int = 0 // 【必需】订阅周期:1、月(30天);2、季(90天);3、半年(183天);4、年(365天)
  177. init(id: String = "", userId: String = "", status: Int = 0, endDate: String = "", payType: Int = 0, productName: String = "", levels: String = "", platforms: String = "", point: Int = 0, maxDeviceNum: Int = 0, paymentModel: String = "", isAi: String = "", cycle: Int = 0) {
  178. self.id = id
  179. self.userId = userId
  180. self.status = status
  181. self.endDate = endDate
  182. self.payType = payType
  183. self.productName = productName
  184. self.levels = levels
  185. self.platforms = platforms
  186. self.point = point
  187. self.maxDeviceNum = maxDeviceNum
  188. self.paymentModel = paymentModel
  189. self.isAi = isAi
  190. self.cycle = cycle
  191. }
  192. }
  193. class KMMemberLogOff: NSObject {
  194. var currentTime : String? // 【必需】id
  195. var logOffTime : String? // 【必需】用户id
  196. init(currentTime: String? = "", logOffTime: String? = "") {
  197. self.currentTime = currentTime
  198. self.logOffTime = logOffTime
  199. }
  200. }