OOBBSModels.swift 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. //
  2. // OOBBSModels.swift
  3. // O2Platform
  4. //
  5. // Created by 刘振兴 on 2018/4/5.
  6. // Copyright © 2018年 zoneland. All rights reserved.
  7. //
  8. import Foundation
  9. import HandyJSON
  10. import ObjectMapper
  11. // MARK:- 读取Section列表参数
  12. class SubjectsParameter {
  13. var sectionId: String?
  14. var withTopSubject: Bool?
  15. var pageParameter: CommonPageParameter?
  16. }
  17. class CommonPageParameter {
  18. //当前页
  19. var currentPageNo: Int = 1
  20. //每页行数
  21. let countByPage: Int = 20
  22. //总页数
  23. private var totalPageCount = 1
  24. //总行数
  25. var totalLineCount: Int = -1 {
  26. didSet {
  27. if totalLineCount > 0 && totalLineCount > countByPage * currentPageNo {
  28. //总页数
  29. totalPageCount = Int(ceil(Double(totalLineCount) / Double(countByPage)))
  30. }
  31. }
  32. }
  33. init() {
  34. }
  35. func calcNextPageNo() -> Bool {
  36. if currentPageNo < totalPageCount {
  37. currentPageNo += 1
  38. return true
  39. } else {
  40. return false
  41. }
  42. }
  43. }
  44. // MARK:- O2ForumInfo
  45. class O2ForumInfo: NSObject, DataModel {
  46. var createTime: String?
  47. var creatorName: String?
  48. var forumColor: String?
  49. var forumIndexStyle: String?
  50. var forumManagerName: String?
  51. var forumName: String?
  52. var forumNotice: String?
  53. var forumStatus: String?
  54. var forumVisible: String?
  55. var id: String?
  56. var indexListStyle: String?
  57. var indexRecommendable: Bool?
  58. var orderNumber: Int?
  59. var replyNeedAudit: Bool?
  60. var replyPublishAble: String?
  61. var replyTotal: Int?
  62. var replyTotalToday: Int?
  63. var sectionCreateAble: Bool?
  64. var sectionInfoList: [O2SectionInfo]?
  65. var sectionTotal: Int?
  66. var subjectNeedAudit: Bool?
  67. var subjectPublishAble: String?
  68. var subjectTotal: Int?
  69. var subjectTotalToday: Int?
  70. var subjectType: String?
  71. var typeCategory: String?
  72. var updateTime: String?
  73. required override init() {
  74. }
  75. }
  76. // MARK:- O2SectionInfo
  77. class O2SectionInfo: NSObject, DataModel {
  78. var createTime: String?
  79. var creatorName: String?
  80. var forumId: String?
  81. var forumName: String?
  82. var icon: String?
  83. var id: String?
  84. var indexRecommendable: Bool?
  85. var mainSectionId: String?
  86. var mainSectionName: String?
  87. var moderatorNames: String?
  88. var orderNumber: Int?
  89. var replyNeedAudit: Bool?
  90. var replyPublishAble: String?
  91. var replyTotal: Int?
  92. var replyTotalToday: Int?
  93. var sectionDescription: String?
  94. var sectionLevel: String?
  95. var sectionName: String?
  96. var sectionNotice: String?
  97. var sectionStatus: String?
  98. var sectionType: String?
  99. var sectionVisible: String?
  100. var subSectionCreateAble: Bool?
  101. var subjectNeedAudit: Bool?
  102. var subjectPublishAble: String?
  103. var subjectTotal: Int?
  104. var subjectTotalToday: Int?
  105. var subjectType: String?
  106. var typeCategory: String?
  107. var updateTime: String?
  108. required override init() {
  109. }
  110. }
  111. // MARK:- O2BBSubjectDetailInfo
  112. class O2BBSubjectDetailInfo: NSObject, DataModel {
  113. var lastSubject: O2BBSSubjectInfo?
  114. var currentSubject: O2BBSSubjectInfo?
  115. var nextSubject: O2BBSSubjectInfo?
  116. required override init() {
  117. }
  118. }
  119. // MARK:- O2BBSSubjectInfo
  120. class O2BBSSubjectInfo: NSObject, DataModel {
  121. var acceptReplyId: String?
  122. var attachmentList: [AnyObject]?
  123. var auditorName: String?
  124. var auditorNameShort: String?
  125. var bBSIndexSetterName: String?
  126. var bBSIndexSetterNameShort: String?
  127. var createTime: String?
  128. var creatorName: String?
  129. var creatorNameShort: String?
  130. var forumId: String?
  131. var forumIndexSetterName: String?
  132. var forumName: String?
  133. var hostIp: String?
  134. var hot: Int?
  135. var id: String?
  136. var isCompleted: Bool?
  137. var isCreamSubject: Bool?
  138. var isOriginalSubject: Bool?
  139. var isRecommendSubject: Bool?
  140. var isTopSubject: Bool?
  141. var latestReplyId: String?
  142. var latestReplyTime: String?
  143. var latestReplyUser: String?
  144. var latestReplyUserShort: String?
  145. var machineName: String?
  146. var mainSectionId: String?
  147. var mainSectionName: String?
  148. var orderNumber: Int?
  149. var originalSetterName: String?
  150. var originalSetterNameShort: String?
  151. var picId: String?
  152. var recommendTime: String?
  153. var recommendToBBSIndex: Bool?
  154. var recommendToForumIndex: Bool?
  155. var recommendorName: String?
  156. var replyTotal: Int?
  157. var screamSetterName: String?
  158. var screamSetterNameShort: String?
  159. var screamSetterTime: String?
  160. var sectionId: String?
  161. var sectionName: String?
  162. var stopReply: Bool?
  163. var subjectAuditStatus: String?
  164. var subjectStatus: String?
  165. var summary: String?
  166. var systemType: String?
  167. var title: String?
  168. var topToBBS: Bool?
  169. var topToForum: Bool?
  170. var topToMainSection: Bool?
  171. var topToSection: Bool?
  172. var type: String?
  173. var typeCategory: String?
  174. var updateTime: String?
  175. var viewTotal: Int?
  176. var voteCount: Int?
  177. var votePersonVisible: Bool?
  178. var voteResultVisible: Bool?
  179. var voted: Bool?
  180. required override init() {}
  181. }
  182. //附件对象列表
  183. class O2BBSSubjectAttachmentInfo: NSObject, DataModel {
  184. @objc var id: String?
  185. @objc var createTime: String?
  186. @objc var updateTime: String?
  187. @objc var lastUpdateTime: String?
  188. @objc var storage: String?
  189. @objc var forumId: String?
  190. @objc var forumName: String?
  191. @objc var sectionId: String?
  192. @objc var sectionName: String?
  193. @objc var mainSectionId: String?
  194. @objc var mainSectionName: String?
  195. @objc var subjectId: String?
  196. @objc var title: String?
  197. @objc var name: String?
  198. @objc var fileName: String?
  199. @objc var fileHost: String?
  200. @objc var filePath: String?
  201. @objc var storageName: String?
  202. @objc var desc: String?
  203. @objc var creatorUid: String?
  204. @objc var ext: String?
  205. var length: Int?
  206. required override init() {}
  207. func mapping(mapper: HelpingMapper) {
  208. mapper <<< self.ext <-- "extension"
  209. mapper <<< self.desc <-- "description"
  210. }
  211. }
  212. // 禁言对象
  213. class O2BBSMuteInfo: NSObject, DataModel {
  214. @objc var id: String?
  215. @objc var `operator`: String? // 操作人
  216. @objc var person: String? // 被禁言人
  217. @objc var unmuteDate: String? // 解禁日期
  218. @objc var unmuteDateTime: String?
  219. @objc var reason: String? // 禁言理由
  220. @objc var createTime: String?
  221. @objc var updateTime: String?
  222. required override init() {}
  223. }