1.0.0
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
#pragma once
|
||||
#include <QObject>
|
||||
#include "HttpHelper.h"
|
||||
#include <QJsonObject>
|
||||
#include <QString>
|
||||
|
||||
class UpdateLogic : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit UpdateLogic(QObject* parent = nullptr);
|
||||
|
||||
void checkUpdate();
|
||||
void getDownloadUrl(const QString& appId, const QString& channel, const QString& ver, int verId);
|
||||
void reportUpdateResult(const QString& deviceId, const QString& fromVer, const QString& toVer, bool success);
|
||||
|
||||
bool getNeedUpdate() const { return m_needUpdate; }
|
||||
QString getLatestVersion() const { return m_latestVer; }
|
||||
QJsonObject getCheckResult() const { return m_checkResp; }
|
||||
bool isNetworkOk() const { return m_networkOk; }
|
||||
int lastStatusCode() const { return m_lastStatusCode; }
|
||||
|
||||
QString getAppId() const { return m_appId; }
|
||||
QString getChannel() const { return m_channel; }
|
||||
|
||||
private:
|
||||
HttpHelper m_http;
|
||||
QString m_serverAddr;
|
||||
QString m_appId;
|
||||
QString m_curVer;
|
||||
QString m_channel;
|
||||
|
||||
bool m_needUpdate = false;
|
||||
bool m_networkOk = false;
|
||||
int m_lastStatusCode = 0;
|
||||
QString m_latestVer;
|
||||
QJsonObject m_checkResp;
|
||||
};
|
||||
Reference in New Issue
Block a user