packinfoseed2server.h 842 B

123456789101112131415161718192021222324252627282930313233343536
  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. public slots:
  17. void send(QSharedPointer<PackInfo> & info);
  18. private slots:
  19. void doSend();
  20. void result(int code, const QJsonObject & body);
  21. private:
  22. uint _netErrorCount;
  23. QQueue<QSharedPointer<PackInfo>> _queue;
  24. QSharedPointer<PackInfo> _current;
  25. PackInfoManger * _manger;
  26. HttpRequest _requst;
  27. bool _autoSync;
  28. uint _oneSyncError;
  29. PQ::PQLog * log;
  30. };
  31. #endif // PACKINFOSEED2SERVER_H