1.0 finish

This commit is contained in:
2025-03-25 02:44:59 +08:00
parent cc7c995549
commit c84b88a422
23 changed files with 1126 additions and 127 deletions

View File

@@ -284,7 +284,7 @@ void TCHttpService::setConfiguration(QString userName, QString firstPwd, QString
if (code == 0) {
this->m_token = jsonObj["token"].toString();
qDebug() << this->m_token;
this->m_isOnline = true;
apiMyfileCount();
}
@@ -300,15 +300,18 @@ void TCHttpService::setConfiguration(QString userName, QString firstPwd, QString
int total = jsonObj["total"].toInt();
this->m_total = total;
int n = total / 10 + 1;
int pendingRequests = n;
for (int i = 0; i < n; i++) {
//0 10 20
int count = (total - i * 10 >= 10) ? 10 : (total - i * 10);
apiMyfileNormal(i*10, count);
}
}
}
if (api == "myfilenormal") {
static int loginCnt = 0;
QJsonDocument jsonDoc = QJsonDocument::fromJson(rawData);
if (jsonDoc.isEmpty())
return;
@@ -328,15 +331,23 @@ void TCHttpService::setConfiguration(QString userName, QString firstPwd, QString
QString md5 = jsonObj["md5"].toString();
QMap<QString, file_info_t>::iterator ite;
ite = m_fileMap.find(file_name);
ite = m_fileMap.find(md5);
if (ite == m_fileMap.end()) {
qDebug() << file_name;
file_info_t info;
info.share_status = share_status;
info.size = size;
info.url = url;
info.file_name = file_name;
emit signal_uploadFileSec(url);
if (m_isOnline) {
qDebug() << "now upload";
emit signal_uploadFileSec(url);
}
m_fileMap.insert(md5, info);
// if (m_fileMap.size() == m_total && m_isOnline == false)
}
#if !DEBUG
// for(auto ite = m_fileMap.constBegin(); ite != m_fileMap.constEnd(); ite++) {
@@ -345,7 +356,14 @@ void TCHttpService::setConfiguration(QString userName, QString firstPwd, QString
qDebug() << "fileMap size:" << m_fileMap.size();
#endif
}
if (!m_isOnline) {
loginCnt++;
qDebug() << "loginCnt:" << loginCnt;
if (loginCnt == m_total/10+1) {
m_isOnline = true;
qDebug() << "login success";
}
}
}
// if (api == "upload") {

View File

@@ -72,8 +72,6 @@ private:
bool m_uploadNum = 0;
signals:
};
#endif // TCHTTPSERVICE_H