packinfoseed2server.h 921 B

12345678910111213141516171819202122232425262728293031323334353637
  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. #include <pqQtlib/log/pqlog.h>
  9. // 码单的上传
  10. class PackInfoSeed2Server : public QObject
  11. {
  12. Q_OBJECT
  13. public:
  14. explicit PackInfoSeed2Server(PackInfoManger * manger,QObject *parent = nullptr,bool autoSync = false);
  15. signals:
  16. void syncEnd();
  17. public slots:
  18. void send(QSharedPointer<PackInfo> & info);
  19. void sendList(QList<QSharedPointer<PackInfo>> & infos);
  20. private slots:
  21. void doSend();
  22. void result(int code, const QJsonObject & body);
  23. private:
  24. uint _netErrorCount;
  25. QQueue<QSharedPointer<PackInfo>> _queue;
  26. QSharedPointer<PackInfo> _current;
  27. PackInfoManger * _manger;
  28. HttpRequest _requst;
  29. bool _autoSync;
  30. uint _oneSyncError;
  31. PQ::PQLog * log;
  32. };
  33. #endif // PACKINFOSEED2SERVER_H