chatapi.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef CHATAPI_H
  2. #define CHATAPI_H
  3. #include <QFuture>
  4. #include <QJsonObject>
  5. #include <QString>
  6. #include "../network/networkaccessmanager.h"
  7. namespace ChatApi {
  8. /**
  9. * 创建聊天室
  10. * @param roomName 聊天室名称
  11. * @param description 聊天室描述
  12. * @param maxUsers 最大用户数
  13. * @return 返回包含基本响应的 Future
  14. */
  15. QFuture<HttpResponse> createRoom(const QString& roomName, const QString& description = "", int maxUsers = 100);
  16. /**
  17. * 获取聊天室列表
  18. * @param page 页码
  19. * @param pageSize 每页大小
  20. * @return 返回包含聊天室列表的 Future
  21. */
  22. QFuture<HttpResponse> getRoomList(int page = 1, int pageSize = 10);
  23. /**
  24. * 重置房间统计数据
  25. * @param roomId 房间ID
  26. * @return 返回包含基本响应的 Future
  27. */
  28. QFuture<HttpResponse> resetRoomStats(const QString& roomId);
  29. /**
  30. * 重置用户消息统计数据
  31. * @param roomId 房间ID
  32. * @param userId 用户ID
  33. * @return 返回包含基本响应的 Future
  34. */
  35. QFuture<HttpResponse> resetUserStats(const QString& roomId, const QString& userId);
  36. } // namespace ChatApi
  37. #endif // CHATAPI_H