IMConversationInfo.swift 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. //
  2. // IMConversation.swift
  3. // O2Platform
  4. //
  5. // Created by FancyLou on 2020/6/4.
  6. // Copyright © 2020 zoneland. All rights reserved.
  7. //
  8. import HandyJSON
  9. class IMConversationInfo: NSObject, DataModel {
  10. @objc var id: String?
  11. @objc var title: String?
  12. @objc var type: String? //会话类型 单人 、 群.
  13. @objc var personList: [String]?
  14. @objc var adminPerson: String?
  15. @objc var note: String?
  16. @objc var lastMessageTime: String?
  17. @objc var createTime: String?
  18. @objc var updateTime: String?
  19. var unreadNumber: Int?
  20. var isTop: Bool?
  21. @objc var lastMessage: IMMessageInfo?
  22. required override init() { }
  23. func mapping(mapper: HelpingMapper) {
  24. }
  25. }
  26. class IMConversationUpdateForm: NSObject, DataModel {
  27. @objc var id: String?
  28. @objc var title: String?
  29. @objc var personList: [String]?
  30. @objc var adminPerson: String?
  31. @objc var note: String?
  32. required override init() { }
  33. func mapping(mapper: HelpingMapper) {
  34. }
  35. }
  36. class IMMessageRequestForm: NSObject, DataModel {
  37. @objc var conversationId: String?
  38. required override init() { }
  39. func mapping(mapper: HelpingMapper) {
  40. }
  41. }
  42. class IMMessageInfo: NSObject, DataModel {
  43. @objc var id: String?
  44. @objc var conversationId: String?
  45. @objc var body: String?
  46. @objc var createPerson: String?
  47. @objc var createTime: String?
  48. @objc var updateTime: String?
  49. required override init() { }
  50. func mapping(mapper: HelpingMapper) {
  51. }
  52. }
  53. class IMMessageBodyInfo: NSObject, DataModel {
  54. @objc var id: String?
  55. @objc var type: String?
  56. @objc var body: String?
  57. @objc var fileId: String? //文件id
  58. @objc var fileExtension: String? //文件扩展
  59. @objc var fileTempPath: String? //本地临时文件地址
  60. @objc var audioDuration: String? // 音频文件时长
  61. @objc var address: String? //type=location的时候位置信息
  62. @objc var addressDetail: String?
  63. var latitude: Double?//type=location的时候位置信息
  64. var longitude: Double?//type=location的时候位置信息
  65. required override init() { }
  66. func mapping(mapper: HelpingMapper) {
  67. }
  68. }
  69. class IMUploadBackModel: NSObject, DataModel {
  70. public override var description: String {
  71. return "IMUploadBackModel"
  72. }
  73. @objc var id:String?
  74. @objc var fileExtension: String? //文件扩展
  75. required override init() { }
  76. func mapping(mapper: HelpingMapper) {
  77. }
  78. }
  79. //websocket 消息对象
  80. class WsMessage: NSObject, DataModel {
  81. @objc var type: String? //im_create
  82. @objc var body: IMMessageInfo? //这个对象只有 type=im_create的时候才是这个对象
  83. required override init() { }
  84. func mapping(mapper: HelpingMapper) {
  85. }
  86. }
  87. //其他消息
  88. class InstantMessage: NSObject, DataModel {
  89. @objc var id: String?
  90. @objc var title: String?
  91. @objc var type: String?
  92. @objc var body: String?
  93. @objc var consumerList: [String]?
  94. @objc var person: String?
  95. var consumed: Bool?
  96. @objc var createTime: String?
  97. @objc var updateTime: String?
  98. required override init() { }
  99. func mapping(mapper: HelpingMapper) {
  100. }
  101. }
  102. struct O2LocationData {
  103. var address: String?
  104. var addressDetail: String?
  105. var latitude: Double?
  106. var longitude: Double?
  107. }