ChatsStore.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. //
  2. // ChatsStore.h
  3. // AIIM
  4. //
  5. // Created by gan on 2025/4/1.
  6. //
  7. #ifndef ChatsStore_h
  8. #define ChatsStore_h
  9. #endif /* ChatsStore_h */
  10. #import "GIMobj.h"
  11. @protocol ChatsStoreDelegate <NSObject>
  12. @optional
  13. - (void)ChatsChange:(NSArray *_Nullable)msgList type:(NSInteger)typpe;
  14. @end
  15. @interface ChatsStore : NSObject
  16. + (ChatsStore *_Nonnull)shareInstance;
  17. @property (nonatomic,weak) id <ChatsStoreDelegate> delegate;
  18. @property (nonatomic,strong) NSMutableArray * _Nullable msgList;
  19. @property (nonatomic,strong) NSString * _Nullable chatId;
  20. @property (nonatomic) NSInteger lastreadTime;
  21. @property (nonatomic,strong) NSString * _Nullable userid;
  22. @property (nonatomic,strong) NSArray * _Nullable groupUserList;
  23. -(void)reciveMsg:(NSDictionary *_Nonnull)msg;
  24. -(void)deleteMineTmpMsg:(NSDictionary *_Nonnull)msg;
  25. //第一次打开,连带请求所有离线消息
  26. -(void)getGroupUserList:(NSString *_Nonnull)chatId;//获取群成员信息
  27. -(void)reloadData:(NSString *_Nonnull)chatId type:(NSInteger)type;//单聊
  28. -(void)reloadQunData:(NSString *_Nonnull)chatId type:(NSInteger)type;//群聊
  29. -(void)reloadData:(NSString *_Nonnull)chatId;
  30. //更新最后已读时间
  31. -(void)updatereadTime:(NSDictionary *_Nullable)dis;
  32. -(NSDictionary *_Nullable)getchatReadTime:(NSString *_Nullable)chatId;
  33. -(void)loadNextData:(NSString *_Nullable)chatId timestp:(NSInteger)timestp;
  34. -(void)loadQunNextData:(NSString *_Nullable)chatId timestp:(NSInteger)timestp;
  35. //获取群组历史记录 先获取群成员列表
  36. -(void)getGroupHistory:(NSString *_Nonnull)groupId type:(NSString *_Nullable)type;
  37. //按消息分类查询本消息
  38. -(void)reloadDataWithType:(NSString *_Nonnull)chatId type:(NSString *_Nullable)type;
  39. -(void)loadNextDataAll:(NSString *_Nonnull)chatId timestp:(NSInteger)timestp;
  40. //安消息分类查询本地消息下一页
  41. -(void)loadNextDataWithType:(NSString *_Nonnull)chatId type:(NSString *_Nullable)type timestp:(NSInteger)timestp;
  42. //字典型数组排序
  43. -(NSArray *_Nullable)arraysort:(NSArray *_Nullable)array;
  44. //替换指定数据
  45. -(NSArray *_Nullable)replaydisData:(NSDictionary *_Nullable)dis inarray:(NSArray *_Nullable)array;
  46. //消息列表中执行删除操作
  47. -(void)deleteMyLocalMsg:(NSDictionary *_Nonnull)msg;
  48. @end