KMMemberCenterResult.swift 8.2 KB

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