MessageModel.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. //
  2. // MessageModel.h
  3. // SLAiELTS
  4. //
  5. // Created by Gusont on 2023/3/3.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #import "SLMikeSegmentModel.h"
  9. @class SLMessageSendModel;
  10. @class SLMessageDetail;
  11. NS_ASSUME_NONNULL_BEGIN
  12. @interface MessageModel : NSObject
  13. @property (nonatomic, strong) NSString *sendText;
  14. /// 译文
  15. @property (nonatomic, strong) NSString *sendTextTrans;
  16. /// 是否接收
  17. @property (nonatomic, assign) BOOL isReceive;
  18. /// 原数据是否是语音
  19. @property (nonatomic, assign) BOOL isMike;
  20. /// 是否显示语音
  21. @property (nonatomic, assign) BOOL showMike;
  22. /// 正在播放
  23. @property (nonatomic, assign) BOOL onBroadcast;
  24. /// 是否显示text
  25. @property (nonatomic, assign) BOOL showText;
  26. @property (nonatomic, strong) NSString *voicePath;
  27. /// 音频时长
  28. @property (nonatomic, assign) NSTimeInterval audioDuration;
  29. /// 时间戳
  30. @property (nonatomic, assign) CGFloat sendTime;
  31. /// 发送失败
  32. @property (nonatomic, assign) BOOL sendFailure;
  33. @property (nonatomic, assign) BOOL showTime;
  34. /// 翻译
  35. @property (nonatomic, assign) BOOL showTrans;
  36. @property (nonatomic, strong) NSString *toId;
  37. //+ (instancetype)initWithSendText:(NSString *)sendText isReceive:(BOOL)isReceive;
  38. + (instancetype)initWithSendText:(NSString *)sendText
  39. isReceive:(BOOL)isReceive
  40. showMike:(BOOL)showMike
  41. showText:(BOOL)showText;
  42. + (instancetype)initWithSendText:(NSString *)sendText
  43. isReceive:(BOOL)isReceive
  44. showMike:(BOOL)showMike
  45. showText:(BOOL)showText
  46. isMike:(BOOL)isMike;
  47. + (instancetype)initWithSendText:(NSString *)sendText
  48. isReceive:(BOOL)isReceive
  49. showMike:(BOOL)showMike
  50. showText:(BOOL)showText
  51. isMike:(BOOL)isMike
  52. voicePath:(NSString *)voicePath;
  53. + (instancetype)initWithSendText:(NSString *)sendText
  54. isReceive:(BOOL)isReceive
  55. showMike:(BOOL)showMike
  56. showText:(BOOL)showText
  57. isMike:(BOOL)isMike
  58. showTime:(BOOL)showTime
  59. sendTime:(CGFloat)sendTime
  60. voicePath:(NSString *)voicePath
  61. sendFailure:(BOOL)sendFailure
  62. sendTextTrans:(NSString *)sendTextTrans;
  63. @end
  64. @interface SLMessageSendModel : NSObject
  65. @property (nonatomic, strong) NSMutableArray<SLMessageDetail *> *messages;
  66. @property (nonatomic, strong) NSString *sign;
  67. @property (nonatomic, strong) NSString *timestamp;
  68. @property (nonatomic, assign) NSInteger chatType;
  69. @property (nonatomic, strong) NSString *toId;
  70. @property (nonatomic, strong) NSString *message;
  71. @property (nonatomic, assign) NSInteger messageType;
  72. @end
  73. @interface SLMessageDetail : NSObject
  74. @property (nonatomic, strong) NSString *role;
  75. @property (nonatomic, strong) NSString *content;
  76. @end
  77. @interface SLSocketMessage : NSObject
  78. @property (nonatomic, strong) NSString *AIId;
  79. @property (nonatomic, strong) NSString *AIName;
  80. @property (nonatomic, strong) NSString *UserId;
  81. @property (nonatomic, strong) NSString *MessageId;
  82. @property (nonatomic, strong) NSString *Message;
  83. //文字0 语音1
  84. @property (nonatomic, assign) BOOL MessageType;
  85. //私聊0 群聊1
  86. @property (nonatomic, assign) BOOL ChatType;
  87. @end
  88. @interface SLMessageManager : NSObject
  89. + (instancetype)SharedInstance;
  90. - (void)saveSocketChatMessageWith:(NSDictionary *)resultDic;
  91. @end
  92. @interface SLMessageReceiveModel : NSObject
  93. @property (nonatomic, strong) NSString *sendDate;
  94. @property (nonatomic, strong) NSString *chatType;
  95. @property (nonatomic, strong) NSString *message;
  96. //0文字1语音
  97. @property (nonatomic, assign) BOOL messageType;
  98. //0发送1接收
  99. @property (nonatomic, assign) BOOL interactMode;
  100. @end
  101. NS_ASSUME_NONNULL_END