packinfoseed2server.h 764 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef PACKINFOSEED2SERVER_H
  2. #define PACKINFOSEED2SERVER_H
  3. #include <QObject>
  4. #include "httprequest.h"
  5. #include "struct_/packinfo.h"
  6. #include <QQueue>
  7. #include "packinfomanger.h"
  8. // 码单的上传
  9. class PackInfoSeed2Server : public QObject
  10. {
  11. Q_OBJECT
  12. public:
  13. explicit PackInfoSeed2Server(PackInfoManger * manger,QObject *parent = nullptr,bool autoSync = false);
  14. signals:
  15. public slots:
  16. void send(QSharedPointer<PackInfo> & info);
  17. private slots:
  18. void doSend();
  19. void result(int code, const QJsonObject & body);
  20. private:
  21. uint _failedCount;
  22. QQueue<QSharedPointer<PackInfo>> _queue;
  23. QSharedPointer<PackInfo> _current;
  24. PackInfoManger * _manger;
  25. HttpRequest _requst;
  26. bool _autoSync;
  27. };
  28. #endif // PACKINFOSEED2SERVER_H