ChatsStore.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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) NSInteger reloadC;
  19. @property (nonatomic,strong) NSMutableArray * _Nullable msgList;
  20. @property (nonatomic,strong) NSString * _Nullable chatId;
  21. @property (nonatomic) NSInteger lastreadTime;
  22. @property (nonatomic,strong) NSString * _Nullable userid;
  23. @property (nonatomic,strong) NSArray * _Nullable groupUserList;
  24. -(void)reciveMsg:(NSDictionary *_Nonnull)msg;
  25. -(void)deleteMineTmpMsg:(NSDictionary *_Nonnull)msg;
  26. //第一次打开,连带请求所有离线消息
  27. -(void)getGroupUserList:(NSString *_Nonnull)chatId;//获取群成员信息
  28. -(void)reloadData:(NSString *_Nonnull)chatId type:(NSInteger)type;//单聊
  29. -(void)reloadQunData:(NSString *_Nonnull)chatId type:(NSInteger)type;//群聊
  30. -(void)reloadData:(NSString *_Nonnull)chatId;
  31. //更新最后已读时间
  32. -(void)updatereadTime:(NSDictionary *_Nullable)dis;
  33. -(NSDictionary *_Nullable)getchatReadTime:(NSString *_Nullable)chatId;
  34. -(void)loadNextData:(NSString *_Nullable)chatId timestp:(NSInteger)timestp;
  35. -(void)loadQunNextData:(NSString *_Nullable)chatId timestp:(NSInteger)timestp;
  36. //获取群组历史记录 先获取群成员列表
  37. -(void)getGroupHistory:(NSString *_Nonnull)groupId type:(NSString *_Nullable)type;
  38. //按消息分类查询本消息
  39. -(void)reloadDataWithType:(NSString *_Nonnull)chatId type:(NSString *_Nullable)type;
  40. -(void)loadNextDataAll:(NSString *_Nonnull)chatId timestp:(NSInteger)timestp;
  41. //安消息分类查询本地消息下一页
  42. -(void)loadNextDataWithType:(NSString *_Nonnull)chatId type:(NSString *_Nullable)type timestp:(NSInteger)timestp;
  43. //字典型数组排序
  44. -(NSArray *_Nullable)arraysort:(NSArray *_Nullable)array;
  45. //替换指定数据
  46. -(NSArray *_Nullable)replaydisData:(NSDictionary *_Nullable)dis inarray:(NSArray *_Nullable)array;
  47. //消息列表中执行删除操作
  48. -(void)deleteMyLocalMsg:(NSDictionary *_Nonnull)msg;
  49. @end