Implemented `GetCardInfoScript`, `GetProfileInfoScript`, and `GetLastTransactionsScript` to automate data extraction workflows for Ozon platform. Includes support for XML parsing, ad banner handling, card navigation, profile parsing, and transaction retrieval. Added related asset files.
46 lines
1.2 KiB
C++
46 lines
1.2 KiB
C++
#pragma once
|
|
#include <QObject>
|
|
#include <QNetworkAccessManager>
|
|
#include <dao/DeviceDAO.h>
|
|
#include <db/DeviceInfo.h>
|
|
|
|
class DeviceScreener final : public QObject {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit DeviceScreener(QObject *parent = nullptr);
|
|
|
|
~DeviceScreener() override;
|
|
|
|
public slots:
|
|
void start();
|
|
|
|
void stop();
|
|
|
|
signals:
|
|
void finished();
|
|
|
|
private:
|
|
bool m_running = true;
|
|
QString m_urlAppUpdate;
|
|
QString m_token;
|
|
QString m_apiBase;
|
|
QNetworkAccessManager *m_manager = nullptr;
|
|
QMap<QString, qint64> m_lastApiUpdate; // deviceId → unix timestamp последнего PATCH
|
|
|
|
static QList<QPair<QString, QString> > readAdbDevices();
|
|
|
|
static QByteArray takeScreenshot(const QString &deviceId);
|
|
|
|
static DeviceInfo readDeviceInfo(const QString &deviceId, bool isChecked);
|
|
|
|
void postDevicesData(const QList<DeviceInfo> &devices);
|
|
|
|
QJsonValue apiPost(const QString &path, const QJsonObject &body);
|
|
void apiPatch(const QString &path, const QJsonObject &body);
|
|
|
|
QString createDeviceOnApi(const DeviceInfo &device);
|
|
void updateDeviceOnApi(const DeviceInfo &device);
|
|
void postScreenshotToApi(const QString &apiId, const QByteArray &image);
|
|
};
|