mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-14 12:52:04 +08:00
添加应用详情页下载量显示
This commit is contained in:
@@ -30,6 +30,17 @@ void SparkAPI::get(QUrl url)
|
||||
});
|
||||
httprequest->getRequest(request);
|
||||
}
|
||||
void SparkAPI::getRAW(QUrl url)
|
||||
{
|
||||
QNetworkRequest request;
|
||||
HttpRequest *httprequest=new HttpRequest;
|
||||
request.setUrl(QUrl(url.toString().replace("+","%2B")));
|
||||
connect(httprequest,&HttpRequest::finished,[=](QString data){
|
||||
emit finishedRAW(data);
|
||||
httprequest->deleteLater();
|
||||
});
|
||||
httprequest->getRequest(request);
|
||||
}
|
||||
void SparkAPI::getAppList(QString type)
|
||||
{
|
||||
get(QUrl(getServerUrl()+"store/"+type+"/applist.json"));
|
||||
@@ -42,6 +53,10 @@ void SparkAPI::getAppInfo(QUrl spk)
|
||||
{
|
||||
get(QUrl(getServerUrl()+"store"+spk.path().replace("+","%2B") + "/app.json"));
|
||||
}
|
||||
void SparkAPI::getAppDownloadTimes(QUrl spk)
|
||||
{
|
||||
getRAW(QUrl(getServerUrl()+"store"+spk.path().replace("+","%2B") + "/download-times.txt"));
|
||||
}
|
||||
QString SparkAPI::getServerUrl()
|
||||
{
|
||||
return SparkAPI::serverUrl;
|
||||
|
||||
@@ -13,8 +13,10 @@ public:
|
||||
static QString getServerUrl();
|
||||
static QString getImgServerUrl();
|
||||
static void setServerUrl(QString url);
|
||||
void getAppDownloadTimes(QUrl spk);
|
||||
void getSearchList(QString keyword);
|
||||
void get(QUrl url);
|
||||
void getRAW(QUrl url);
|
||||
void getAppList(QString type);
|
||||
void getAppInfo(QUrl spk);
|
||||
explicit SparkAPI(QObject *parent = nullptr);
|
||||
@@ -24,6 +26,7 @@ private:
|
||||
|
||||
signals:
|
||||
void finished(QJsonArray);
|
||||
void finishedRAW(QString);
|
||||
void finishedObject(QJsonObject);
|
||||
|
||||
public slots:
|
||||
|
||||
Reference in New Issue
Block a user