Skip to content

Commit

Permalink
test addDownloadProgress
Browse files Browse the repository at this point in the history
  • Loading branch information
wing328 committed Aug 4, 2024
1 parent 2a37bb9 commit 1bc6d2f
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 23 deletions.
1 change: 1 addition & 0 deletions bin/configs/cpp-qt-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ additionalProperties:
packageName: CppQtPetstoreClient
cppNamespace: test_namespace
modelNamePrefix: PFX
addDownloadProgress: true
18 changes: 9 additions & 9 deletions samples/client/petstore/cpp-qt/client/PFXPetApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ void PFXPetApi::addPet(const PFXPet &pfx_pet) {
input.headers.insert(keyValueIt->first, keyValueIt->second);
}


connect(worker, &PFXHttpRequestWorker::downloadProgress, this, &PFXPetApi::addPetProgress);
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::addPetCallback);
connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater);
connect(worker, &QObject::destroyed, this, [this]() {
Expand Down Expand Up @@ -349,7 +349,7 @@ void PFXPetApi::allPets() {
input.headers.insert(keyValueIt->first, keyValueIt->second);
}


connect(worker, &PFXHttpRequestWorker::downloadProgress, this, &PFXPetApi::allPetsProgress);
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::allPetsCallback);
connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater);
connect(worker, &QObject::destroyed, this, [this]() {
Expand Down Expand Up @@ -448,7 +448,7 @@ void PFXPetApi::deletePet(const qint64 &pet_id, const ::test_namespace::Optional
input.headers.insert(keyValueIt->first, keyValueIt->second);
}


connect(worker, &PFXHttpRequestWorker::downloadProgress, this, &PFXPetApi::deletePetProgress);
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::deletePetCallback);
connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater);
connect(worker, &QObject::destroyed, this, [this]() {
Expand Down Expand Up @@ -643,7 +643,7 @@ void PFXPetApi::findPetsByStatus(const QList<QString> &status) {
input.headers.insert(keyValueIt->first, keyValueIt->second);
}


connect(worker, &PFXHttpRequestWorker::downloadProgress, this, &PFXPetApi::findPetsByStatusProgress);
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::findPetsByStatusCallback);
connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater);
connect(worker, &QObject::destroyed, this, [this]() {
Expand Down Expand Up @@ -848,7 +848,7 @@ void PFXPetApi::findPetsByTags(const QList<QString> &tags) {
input.headers.insert(keyValueIt->first, keyValueIt->second);
}


connect(worker, &PFXHttpRequestWorker::downloadProgress, this, &PFXPetApi::findPetsByTagsProgress);
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::findPetsByTagsCallback);
connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater);
connect(worker, &QObject::destroyed, this, [this]() {
Expand Down Expand Up @@ -985,7 +985,7 @@ void PFXPetApi::getPetById(const qint64 &pet_id) {
input.headers.insert(keyValueIt->first, keyValueIt->second);
}


connect(worker, &PFXHttpRequestWorker::downloadProgress, this, &PFXPetApi::getPetByIdProgress);
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::getPetByIdCallback);
connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater);
connect(worker, &QObject::destroyed, this, [this]() {
Expand Down Expand Up @@ -1060,7 +1060,7 @@ void PFXPetApi::updatePet(const PFXPet &pfx_pet) {
input.headers.insert(keyValueIt->first, keyValueIt->second);
}


connect(worker, &PFXHttpRequestWorker::downloadProgress, this, &PFXPetApi::updatePetProgress);
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::updatePetCallback);
connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater);
connect(worker, &QObject::destroyed, this, [this]() {
Expand Down Expand Up @@ -1191,7 +1191,7 @@ void PFXPetApi::updatePetWithForm(const qint64 &pet_id, const ::test_namespace::
input.headers.insert(keyValueIt->first, keyValueIt->second);
}


connect(worker, &PFXHttpRequestWorker::downloadProgress, this, &PFXPetApi::updatePetWithFormProgress);
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::updatePetWithFormCallback);
connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater);
connect(worker, &QObject::destroyed, this, [this]() {
Expand Down Expand Up @@ -1322,7 +1322,7 @@ void PFXPetApi::uploadFile(const qint64 &pet_id, const ::test_namespace::Optiona
input.headers.insert(keyValueIt->first, keyValueIt->second);
}


connect(worker, &PFXHttpRequestWorker::downloadProgress, this, &PFXPetApi::uploadFileProgress);
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::uploadFileCallback);
connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater);
connect(worker, &QObject::destroyed, this, [this]() {
Expand Down
9 changes: 9 additions & 0 deletions samples/client/petstore/cpp-qt/client/PFXPetApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,15 @@ class PFXPetApi : public QObject {
void updatePetWithFormSignal();
void uploadFileSignal(PFXApiResponse summary);

void addPetProgress(qint64 bytesReceived, qint64 bytesTotal);
void allPetsProgress(qint64 bytesReceived, qint64 bytesTotal);
void deletePetProgress(qint64 bytesReceived, qint64 bytesTotal);
void findPetsByStatusProgress(qint64 bytesReceived, qint64 bytesTotal);
void findPetsByTagsProgress(qint64 bytesReceived, qint64 bytesTotal);
void getPetByIdProgress(qint64 bytesReceived, qint64 bytesTotal);
void updatePetProgress(qint64 bytesReceived, qint64 bytesTotal);
void updatePetWithFormProgress(qint64 bytesReceived, qint64 bytesTotal);
void uploadFileProgress(qint64 bytesReceived, qint64 bytesTotal);

void addPetSignalFull(PFXHttpRequestWorker *worker);
void allPetsSignalFull(PFXHttpRequestWorker *worker, QSet<PFXPet> summary);
Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/cpp-qt/client/PFXPrimitivesApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ void PFXPrimitivesApi::primitivesIntegerPost(const ::test_namespace::OptionalPar
input.headers.insert(keyValueIt->first, keyValueIt->second);
}


connect(worker, &PFXHttpRequestWorker::downloadProgress, this, &PFXPrimitivesApi::primitivesIntegerPostProgress);
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPrimitivesApi::primitivesIntegerPostCallback);
connect(this, &PFXPrimitivesApi::abortRequestsSignal, worker, &QObject::deleteLater);
connect(worker, &QObject::destroyed, this, [this]() {
Expand Down Expand Up @@ -298,7 +298,7 @@ void PFXPrimitivesApi::primitivesNumberPut(const ::test_namespace::OptionalParam
input.headers.insert(keyValueIt->first, keyValueIt->second);
}


connect(worker, &PFXHttpRequestWorker::downloadProgress, this, &PFXPrimitivesApi::primitivesNumberPutProgress);
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPrimitivesApi::primitivesNumberPutCallback);
connect(this, &PFXPrimitivesApi::abortRequestsSignal, worker, &QObject::deleteLater);
connect(worker, &QObject::destroyed, this, [this]() {
Expand Down
2 changes: 2 additions & 0 deletions samples/client/petstore/cpp-qt/client/PFXPrimitivesApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ class PFXPrimitivesApi : public QObject {
void primitivesIntegerPostSignal();
void primitivesNumberPutSignal();

void primitivesIntegerPostProgress(qint64 bytesReceived, qint64 bytesTotal);
void primitivesNumberPutProgress(qint64 bytesReceived, qint64 bytesTotal);

void primitivesIntegerPostSignalFull(PFXHttpRequestWorker *worker);
void primitivesNumberPutSignalFull(PFXHttpRequestWorker *worker);
Expand Down
8 changes: 4 additions & 4 deletions samples/client/petstore/cpp-qt/client/PFXStoreApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ void PFXStoreApi::deleteOrder(const QString &order_id) {
input.headers.insert(keyValueIt->first, keyValueIt->second);
}


connect(worker, &PFXHttpRequestWorker::downloadProgress, this, &PFXStoreApi::deleteOrderProgress);
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXStoreApi::deleteOrderCallback);
connect(this, &PFXStoreApi::abortRequestsSignal, worker, &QObject::deleteLater);
connect(worker, &QObject::destroyed, this, [this]() {
Expand Down Expand Up @@ -312,7 +312,7 @@ void PFXStoreApi::getInventory() {
input.headers.insert(keyValueIt->first, keyValueIt->second);
}


connect(worker, &PFXHttpRequestWorker::downloadProgress, this, &PFXStoreApi::getInventoryProgress);
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXStoreApi::getInventoryCallback);
connect(this, &PFXStoreApi::abortRequestsSignal, worker, &QObject::deleteLater);
connect(worker, &QObject::destroyed, this, [this]() {
Expand Down Expand Up @@ -405,7 +405,7 @@ void PFXStoreApi::getOrderById(const qint64 &order_id) {
input.headers.insert(keyValueIt->first, keyValueIt->second);
}


connect(worker, &PFXHttpRequestWorker::downloadProgress, this, &PFXStoreApi::getOrderByIdProgress);
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXStoreApi::getOrderByIdCallback);
connect(this, &PFXStoreApi::abortRequestsSignal, worker, &QObject::deleteLater);
connect(worker, &QObject::destroyed, this, [this]() {
Expand Down Expand Up @@ -480,7 +480,7 @@ void PFXStoreApi::placeOrder(const PFXOrder &pfx_order) {
input.headers.insert(keyValueIt->first, keyValueIt->second);
}


connect(worker, &PFXHttpRequestWorker::downloadProgress, this, &PFXStoreApi::placeOrderProgress);
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXStoreApi::placeOrderCallback);
connect(this, &PFXStoreApi::abortRequestsSignal, worker, &QObject::deleteLater);
connect(worker, &QObject::destroyed, this, [this]() {
Expand Down
4 changes: 4 additions & 0 deletions samples/client/petstore/cpp-qt/client/PFXStoreApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ class PFXStoreApi : public QObject {
void getOrderByIdSignal(PFXOrder summary);
void placeOrderSignal(PFXOrder summary);

void deleteOrderProgress(qint64 bytesReceived, qint64 bytesTotal);
void getInventoryProgress(qint64 bytesReceived, qint64 bytesTotal);
void getOrderByIdProgress(qint64 bytesReceived, qint64 bytesTotal);
void placeOrderProgress(qint64 bytesReceived, qint64 bytesTotal);

void deleteOrderSignalFull(PFXHttpRequestWorker *worker);
void getInventorySignalFull(PFXHttpRequestWorker *worker, QMap<QString, qint32> summary);
Expand Down
16 changes: 8 additions & 8 deletions samples/client/petstore/cpp-qt/client/PFXUserApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ void PFXUserApi::createUser(const PFXUser &pfx_user) {
input.headers.insert(keyValueIt->first, keyValueIt->second);
}


connect(worker, &PFXHttpRequestWorker::downloadProgress, this, &PFXUserApi::createUserProgress);
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::createUserCallback);
connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater);
connect(worker, &QObject::destroyed, this, [this]() {
Expand Down Expand Up @@ -311,7 +311,7 @@ void PFXUserApi::createUsersWithArrayInput(const QList<PFXUser> &pfx_user) {
input.headers.insert(keyValueIt->first, keyValueIt->second);
}


connect(worker, &PFXHttpRequestWorker::downloadProgress, this, &PFXUserApi::createUsersWithArrayInputProgress);
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::createUsersWithArrayInputCallback);
connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater);
connect(worker, &QObject::destroyed, this, [this]() {
Expand Down Expand Up @@ -384,7 +384,7 @@ void PFXUserApi::createUsersWithListInput(const QList<PFXUser> &pfx_user) {
input.headers.insert(keyValueIt->first, keyValueIt->second);
}


connect(worker, &PFXHttpRequestWorker::downloadProgress, this, &PFXUserApi::createUsersWithListInputProgress);
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::createUsersWithListInputCallback);
connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater);
connect(worker, &QObject::destroyed, this, [this]() {
Expand Down Expand Up @@ -467,7 +467,7 @@ void PFXUserApi::deleteUser(const QString &username) {
input.headers.insert(keyValueIt->first, keyValueIt->second);
}


connect(worker, &PFXHttpRequestWorker::downloadProgress, this, &PFXUserApi::deleteUserProgress);
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::deleteUserCallback);
connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater);
connect(worker, &QObject::destroyed, this, [this]() {
Expand Down Expand Up @@ -550,7 +550,7 @@ void PFXUserApi::getUserByName(const QString &username) {
input.headers.insert(keyValueIt->first, keyValueIt->second);
}


connect(worker, &PFXHttpRequestWorker::downloadProgress, this, &PFXUserApi::getUserByNameProgress);
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::getUserByNameCallback);
connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater);
connect(worker, &QObject::destroyed, this, [this]() {
Expand Down Expand Up @@ -651,7 +651,7 @@ void PFXUserApi::loginUser(const QString &username, const QString &password) {
input.headers.insert(keyValueIt->first, keyValueIt->second);
}


connect(worker, &PFXHttpRequestWorker::downloadProgress, this, &PFXUserApi::loginUserProgress);
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::loginUserCallback);
connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater);
connect(worker, &QObject::destroyed, this, [this]() {
Expand Down Expand Up @@ -722,7 +722,7 @@ void PFXUserApi::logoutUser() {
input.headers.insert(keyValueIt->first, keyValueIt->second);
}


connect(worker, &PFXHttpRequestWorker::downloadProgress, this, &PFXUserApi::logoutUserProgress);
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::logoutUserCallback);
connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater);
connect(worker, &QObject::destroyed, this, [this]() {
Expand Down Expand Up @@ -810,7 +810,7 @@ void PFXUserApi::updateUser(const QString &username, const PFXUser &pfx_user) {
input.headers.insert(keyValueIt->first, keyValueIt->second);
}


connect(worker, &PFXHttpRequestWorker::downloadProgress, this, &PFXUserApi::updateUserProgress);
connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::updateUserCallback);
connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater);
connect(worker, &QObject::destroyed, this, [this]() {
Expand Down
8 changes: 8 additions & 0 deletions samples/client/petstore/cpp-qt/client/PFXUserApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ class PFXUserApi : public QObject {
void logoutUserSignal();
void updateUserSignal();

void createUserProgress(qint64 bytesReceived, qint64 bytesTotal);
void createUsersWithArrayInputProgress(qint64 bytesReceived, qint64 bytesTotal);
void createUsersWithListInputProgress(qint64 bytesReceived, qint64 bytesTotal);
void deleteUserProgress(qint64 bytesReceived, qint64 bytesTotal);
void getUserByNameProgress(qint64 bytesReceived, qint64 bytesTotal);
void loginUserProgress(qint64 bytesReceived, qint64 bytesTotal);
void logoutUserProgress(qint64 bytesReceived, qint64 bytesTotal);
void updateUserProgress(qint64 bytesReceived, qint64 bytesTotal);

void createUserSignalFull(PFXHttpRequestWorker *worker);
void createUsersWithArrayInputSignalFull(PFXHttpRequestWorker *worker);
Expand Down

0 comments on commit 1bc6d2f

Please sign in to comment.