mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-04-08 00:20:17 +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;
|
||||
|
||||
Reference in New Issue
Block a user