forked from loafle/openapi-generator-original
Emit worker also in response signal (#1829)
This commit is contained in:
parent
b015ac9307
commit
c65ef987af
@ -172,6 +172,7 @@ void
|
|||||||
|
|
||||||
if (worker->error_type == QNetworkReply::NoError) {
|
if (worker->error_type == QNetworkReply::NoError) {
|
||||||
emit {{nickname}}Signal({{#returnType}}output{{/returnType}});
|
emit {{nickname}}Signal({{#returnType}}output{{/returnType}});
|
||||||
|
emit {{nickname}}SignalFull(worker{{#returnType}}, output{{/returnType}});
|
||||||
} else {
|
} else {
|
||||||
emit {{nickname}}SignalE({{#returnType}}output, {{/returnType}}error_type, error_str);
|
emit {{nickname}}SignalE({{#returnType}}output, {{/returnType}}error_type, error_str);
|
||||||
emit {{nickname}}SignalEFull(worker, error_type, error_str);
|
emit {{nickname}}SignalEFull(worker, error_type, error_str);
|
||||||
|
@ -33,6 +33,8 @@ private:
|
|||||||
signals:
|
signals:
|
||||||
{{#operations}}{{#operation}}void {{nickname}}Signal({{#returnType}}{{{returnType}}} summary{{/returnType}});
|
{{#operations}}{{#operation}}void {{nickname}}Signal({{#returnType}}{{{returnType}}} summary{{/returnType}});
|
||||||
{{/operation}}{{/operations}}
|
{{/operation}}{{/operations}}
|
||||||
|
{{#operations}}{{#operation}}void {{nickname}}SignalFull({{prefix}}HttpRequestWorker* worker{{#returnType}}, {{{returnType}}} summary{{/returnType}});
|
||||||
|
{{/operation}}{{/operations}}
|
||||||
{{#operations}}{{#operation}}void {{nickname}}SignalE({{#returnType}}{{{returnType}}} summary, {{/returnType}}QNetworkReply::NetworkError error_type, QString& error_str);
|
{{#operations}}{{#operation}}void {{nickname}}SignalE({{#returnType}}{{{returnType}}} summary, {{/returnType}}QNetworkReply::NetworkError error_type, QString& error_str);
|
||||||
{{/operation}}{{/operations}}
|
{{/operation}}{{/operations}}
|
||||||
{{#operations}}{{#operation}}void {{nickname}}SignalEFull({{prefix}}HttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
|
{{#operations}}{{#operation}}void {{nickname}}SignalEFull({{prefix}}HttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||||
|
@ -32,7 +32,7 @@ OAIPetApi::OAIPetApi(QString host, QString basePath) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
OAIPetApi::addPet(const OAIPet& oai_pet) {
|
OAIPetApi::addPet(const OAIPet& body) {
|
||||||
QString fullPath;
|
QString fullPath;
|
||||||
fullPath.append(this->host).append(this->basePath).append("/pet");
|
fullPath.append(this->host).append(this->basePath).append("/pet");
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ OAIPetApi::addPet(const OAIPet& oai_pet) {
|
|||||||
OAIHttpRequestInput input(fullPath, "POST");
|
OAIHttpRequestInput input(fullPath, "POST");
|
||||||
|
|
||||||
|
|
||||||
QString output = oai_pet.asJson();
|
QString output = body.asJson();
|
||||||
input.request_body.append(output);
|
input.request_body.append(output);
|
||||||
|
|
||||||
|
|
||||||
@ -72,6 +72,7 @@ OAIPetApi::addPetCallback(OAIHttpRequestWorker * worker) {
|
|||||||
|
|
||||||
if (worker->error_type == QNetworkReply::NoError) {
|
if (worker->error_type == QNetworkReply::NoError) {
|
||||||
emit addPetSignal();
|
emit addPetSignal();
|
||||||
|
emit addPetSignalFull(worker);
|
||||||
} else {
|
} else {
|
||||||
emit addPetSignalE(error_type, error_str);
|
emit addPetSignalE(error_type, error_str);
|
||||||
emit addPetSignalEFull(worker, error_type, error_str);
|
emit addPetSignalEFull(worker, error_type, error_str);
|
||||||
@ -121,6 +122,7 @@ OAIPetApi::deletePetCallback(OAIHttpRequestWorker * worker) {
|
|||||||
|
|
||||||
if (worker->error_type == QNetworkReply::NoError) {
|
if (worker->error_type == QNetworkReply::NoError) {
|
||||||
emit deletePetSignal();
|
emit deletePetSignal();
|
||||||
|
emit deletePetSignalFull(worker);
|
||||||
} else {
|
} else {
|
||||||
emit deletePetSignalE(error_type, error_str);
|
emit deletePetSignalE(error_type, error_str);
|
||||||
emit deletePetSignalEFull(worker, error_type, error_str);
|
emit deletePetSignalEFull(worker, error_type, error_str);
|
||||||
@ -214,6 +216,7 @@ OAIPetApi::findPetsByStatusCallback(OAIHttpRequestWorker * worker) {
|
|||||||
|
|
||||||
if (worker->error_type == QNetworkReply::NoError) {
|
if (worker->error_type == QNetworkReply::NoError) {
|
||||||
emit findPetsByStatusSignal(output);
|
emit findPetsByStatusSignal(output);
|
||||||
|
emit findPetsByStatusSignalFull(worker, output);
|
||||||
} else {
|
} else {
|
||||||
emit findPetsByStatusSignalE(output, error_type, error_str);
|
emit findPetsByStatusSignalE(output, error_type, error_str);
|
||||||
emit findPetsByStatusSignalEFull(worker, error_type, error_str);
|
emit findPetsByStatusSignalEFull(worker, error_type, error_str);
|
||||||
@ -307,6 +310,7 @@ OAIPetApi::findPetsByTagsCallback(OAIHttpRequestWorker * worker) {
|
|||||||
|
|
||||||
if (worker->error_type == QNetworkReply::NoError) {
|
if (worker->error_type == QNetworkReply::NoError) {
|
||||||
emit findPetsByTagsSignal(output);
|
emit findPetsByTagsSignal(output);
|
||||||
|
emit findPetsByTagsSignalFull(worker, output);
|
||||||
} else {
|
} else {
|
||||||
emit findPetsByTagsSignalE(output, error_type, error_str);
|
emit findPetsByTagsSignalE(output, error_type, error_str);
|
||||||
emit findPetsByTagsSignalEFull(worker, error_type, error_str);
|
emit findPetsByTagsSignalEFull(worker, error_type, error_str);
|
||||||
@ -354,6 +358,7 @@ OAIPetApi::getPetByIdCallback(OAIHttpRequestWorker * worker) {
|
|||||||
|
|
||||||
if (worker->error_type == QNetworkReply::NoError) {
|
if (worker->error_type == QNetworkReply::NoError) {
|
||||||
emit getPetByIdSignal(output);
|
emit getPetByIdSignal(output);
|
||||||
|
emit getPetByIdSignalFull(worker, output);
|
||||||
} else {
|
} else {
|
||||||
emit getPetByIdSignalE(output, error_type, error_str);
|
emit getPetByIdSignalE(output, error_type, error_str);
|
||||||
emit getPetByIdSignalEFull(worker, error_type, error_str);
|
emit getPetByIdSignalEFull(worker, error_type, error_str);
|
||||||
@ -361,7 +366,7 @@ OAIPetApi::getPetByIdCallback(OAIHttpRequestWorker * worker) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
OAIPetApi::updatePet(const OAIPet& oai_pet) {
|
OAIPetApi::updatePet(const OAIPet& body) {
|
||||||
QString fullPath;
|
QString fullPath;
|
||||||
fullPath.append(this->host).append(this->basePath).append("/pet");
|
fullPath.append(this->host).append(this->basePath).append("/pet");
|
||||||
|
|
||||||
@ -369,7 +374,7 @@ OAIPetApi::updatePet(const OAIPet& oai_pet) {
|
|||||||
OAIHttpRequestInput input(fullPath, "PUT");
|
OAIHttpRequestInput input(fullPath, "PUT");
|
||||||
|
|
||||||
|
|
||||||
QString output = oai_pet.asJson();
|
QString output = body.asJson();
|
||||||
input.request_body.append(output);
|
input.request_body.append(output);
|
||||||
|
|
||||||
|
|
||||||
@ -401,6 +406,7 @@ OAIPetApi::updatePetCallback(OAIHttpRequestWorker * worker) {
|
|||||||
|
|
||||||
if (worker->error_type == QNetworkReply::NoError) {
|
if (worker->error_type == QNetworkReply::NoError) {
|
||||||
emit updatePetSignal();
|
emit updatePetSignal();
|
||||||
|
emit updatePetSignalFull(worker);
|
||||||
} else {
|
} else {
|
||||||
emit updatePetSignalE(error_type, error_str);
|
emit updatePetSignalE(error_type, error_str);
|
||||||
emit updatePetSignalEFull(worker, error_type, error_str);
|
emit updatePetSignalEFull(worker, error_type, error_str);
|
||||||
@ -453,6 +459,7 @@ OAIPetApi::updatePetWithFormCallback(OAIHttpRequestWorker * worker) {
|
|||||||
|
|
||||||
if (worker->error_type == QNetworkReply::NoError) {
|
if (worker->error_type == QNetworkReply::NoError) {
|
||||||
emit updatePetWithFormSignal();
|
emit updatePetWithFormSignal();
|
||||||
|
emit updatePetWithFormSignalFull(worker);
|
||||||
} else {
|
} else {
|
||||||
emit updatePetWithFormSignalE(error_type, error_str);
|
emit updatePetWithFormSignalE(error_type, error_str);
|
||||||
emit updatePetWithFormSignalEFull(worker, error_type, error_str);
|
emit updatePetWithFormSignalEFull(worker, error_type, error_str);
|
||||||
@ -506,6 +513,7 @@ OAIPetApi::uploadFileCallback(OAIHttpRequestWorker * worker) {
|
|||||||
|
|
||||||
if (worker->error_type == QNetworkReply::NoError) {
|
if (worker->error_type == QNetworkReply::NoError) {
|
||||||
emit uploadFileSignal(output);
|
emit uploadFileSignal(output);
|
||||||
|
emit uploadFileSignalFull(worker, output);
|
||||||
} else {
|
} else {
|
||||||
emit uploadFileSignalE(output, error_type, error_str);
|
emit uploadFileSignalE(output, error_type, error_str);
|
||||||
emit uploadFileSignalEFull(worker, error_type, error_str);
|
emit uploadFileSignalEFull(worker, error_type, error_str);
|
||||||
|
@ -36,12 +36,12 @@ public:
|
|||||||
QString basePath;
|
QString basePath;
|
||||||
QMap<QString, QString> defaultHeaders;
|
QMap<QString, QString> defaultHeaders;
|
||||||
|
|
||||||
void addPet(const OAIPet& oai_pet);
|
void addPet(const OAIPet& body);
|
||||||
void deletePet(const qint64& pet_id, const QString& api_key);
|
void deletePet(const qint64& pet_id, const QString& api_key);
|
||||||
void findPetsByStatus(const QList<QString>& status);
|
void findPetsByStatus(const QList<QString>& status);
|
||||||
void findPetsByTags(const QList<QString>& tags);
|
void findPetsByTags(const QList<QString>& tags);
|
||||||
void getPetById(const qint64& pet_id);
|
void getPetById(const qint64& pet_id);
|
||||||
void updatePet(const OAIPet& oai_pet);
|
void updatePet(const OAIPet& body);
|
||||||
void updatePetWithForm(const qint64& pet_id, const QString& name, const QString& status);
|
void updatePetWithForm(const qint64& pet_id, const QString& name, const QString& status);
|
||||||
void uploadFile(const qint64& pet_id, const QString& additional_metadata, const OAIHttpRequestInputFileElement*& file);
|
void uploadFile(const qint64& pet_id, const QString& additional_metadata, const OAIHttpRequestInputFileElement*& file);
|
||||||
|
|
||||||
@ -65,6 +65,15 @@ signals:
|
|||||||
void updatePetWithFormSignal();
|
void updatePetWithFormSignal();
|
||||||
void uploadFileSignal(OAIApiResponse summary);
|
void uploadFileSignal(OAIApiResponse summary);
|
||||||
|
|
||||||
|
void addPetSignalFull(OAIHttpRequestWorker* worker);
|
||||||
|
void deletePetSignalFull(OAIHttpRequestWorker* worker);
|
||||||
|
void findPetsByStatusSignalFull(OAIHttpRequestWorker* worker, QList<OAIPet> summary);
|
||||||
|
void findPetsByTagsSignalFull(OAIHttpRequestWorker* worker, QList<OAIPet> summary);
|
||||||
|
void getPetByIdSignalFull(OAIHttpRequestWorker* worker, OAIPet summary);
|
||||||
|
void updatePetSignalFull(OAIHttpRequestWorker* worker);
|
||||||
|
void updatePetWithFormSignalFull(OAIHttpRequestWorker* worker);
|
||||||
|
void uploadFileSignalFull(OAIHttpRequestWorker* worker, OAIApiResponse summary);
|
||||||
|
|
||||||
void addPetSignalE(QNetworkReply::NetworkError error_type, QString& error_str);
|
void addPetSignalE(QNetworkReply::NetworkError error_type, QString& error_str);
|
||||||
void deletePetSignalE(QNetworkReply::NetworkError error_type, QString& error_str);
|
void deletePetSignalE(QNetworkReply::NetworkError error_type, QString& error_str);
|
||||||
void findPetsByStatusSignalE(QList<OAIPet> summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
void findPetsByStatusSignalE(QList<OAIPet> summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||||
|
@ -71,6 +71,7 @@ OAIStoreApi::deleteOrderCallback(OAIHttpRequestWorker * worker) {
|
|||||||
|
|
||||||
if (worker->error_type == QNetworkReply::NoError) {
|
if (worker->error_type == QNetworkReply::NoError) {
|
||||||
emit deleteOrderSignal();
|
emit deleteOrderSignal();
|
||||||
|
emit deleteOrderSignalFull(worker);
|
||||||
} else {
|
} else {
|
||||||
emit deleteOrderSignalE(error_type, error_str);
|
emit deleteOrderSignalE(error_type, error_str);
|
||||||
emit deleteOrderSignalEFull(worker, error_type, error_str);
|
emit deleteOrderSignalEFull(worker, error_type, error_str);
|
||||||
@ -124,6 +125,7 @@ OAIStoreApi::getInventoryCallback(OAIHttpRequestWorker * worker) {
|
|||||||
|
|
||||||
if (worker->error_type == QNetworkReply::NoError) {
|
if (worker->error_type == QNetworkReply::NoError) {
|
||||||
emit getInventorySignal(output);
|
emit getInventorySignal(output);
|
||||||
|
emit getInventorySignalFull(worker, output);
|
||||||
} else {
|
} else {
|
||||||
emit getInventorySignalE(output, error_type, error_str);
|
emit getInventorySignalE(output, error_type, error_str);
|
||||||
emit getInventorySignalEFull(worker, error_type, error_str);
|
emit getInventorySignalEFull(worker, error_type, error_str);
|
||||||
@ -171,6 +173,7 @@ OAIStoreApi::getOrderByIdCallback(OAIHttpRequestWorker * worker) {
|
|||||||
|
|
||||||
if (worker->error_type == QNetworkReply::NoError) {
|
if (worker->error_type == QNetworkReply::NoError) {
|
||||||
emit getOrderByIdSignal(output);
|
emit getOrderByIdSignal(output);
|
||||||
|
emit getOrderByIdSignalFull(worker, output);
|
||||||
} else {
|
} else {
|
||||||
emit getOrderByIdSignalE(output, error_type, error_str);
|
emit getOrderByIdSignalE(output, error_type, error_str);
|
||||||
emit getOrderByIdSignalEFull(worker, error_type, error_str);
|
emit getOrderByIdSignalEFull(worker, error_type, error_str);
|
||||||
@ -178,7 +181,7 @@ OAIStoreApi::getOrderByIdCallback(OAIHttpRequestWorker * worker) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
OAIStoreApi::placeOrder(const OAIOrder& oai_order) {
|
OAIStoreApi::placeOrder(const OAIOrder& body) {
|
||||||
QString fullPath;
|
QString fullPath;
|
||||||
fullPath.append(this->host).append(this->basePath).append("/store/order");
|
fullPath.append(this->host).append(this->basePath).append("/store/order");
|
||||||
|
|
||||||
@ -186,7 +189,7 @@ OAIStoreApi::placeOrder(const OAIOrder& oai_order) {
|
|||||||
OAIHttpRequestInput input(fullPath, "POST");
|
OAIHttpRequestInput input(fullPath, "POST");
|
||||||
|
|
||||||
|
|
||||||
QString output = oai_order.asJson();
|
QString output = body.asJson();
|
||||||
input.request_body.append(output);
|
input.request_body.append(output);
|
||||||
|
|
||||||
|
|
||||||
@ -219,6 +222,7 @@ OAIStoreApi::placeOrderCallback(OAIHttpRequestWorker * worker) {
|
|||||||
|
|
||||||
if (worker->error_type == QNetworkReply::NoError) {
|
if (worker->error_type == QNetworkReply::NoError) {
|
||||||
emit placeOrderSignal(output);
|
emit placeOrderSignal(output);
|
||||||
|
emit placeOrderSignalFull(worker, output);
|
||||||
} else {
|
} else {
|
||||||
emit placeOrderSignalE(output, error_type, error_str);
|
emit placeOrderSignalE(output, error_type, error_str);
|
||||||
emit placeOrderSignalEFull(worker, error_type, error_str);
|
emit placeOrderSignalEFull(worker, error_type, error_str);
|
||||||
|
@ -38,7 +38,7 @@ public:
|
|||||||
void deleteOrder(const QString& order_id);
|
void deleteOrder(const QString& order_id);
|
||||||
void getInventory();
|
void getInventory();
|
||||||
void getOrderById(const qint64& order_id);
|
void getOrderById(const qint64& order_id);
|
||||||
void placeOrder(const OAIOrder& oai_order);
|
void placeOrder(const OAIOrder& body);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void deleteOrderCallback (OAIHttpRequestWorker * worker);
|
void deleteOrderCallback (OAIHttpRequestWorker * worker);
|
||||||
@ -52,6 +52,11 @@ signals:
|
|||||||
void getOrderByIdSignal(OAIOrder summary);
|
void getOrderByIdSignal(OAIOrder summary);
|
||||||
void placeOrderSignal(OAIOrder summary);
|
void placeOrderSignal(OAIOrder summary);
|
||||||
|
|
||||||
|
void deleteOrderSignalFull(OAIHttpRequestWorker* worker);
|
||||||
|
void getInventorySignalFull(OAIHttpRequestWorker* worker, QMap<QString, qint32> summary);
|
||||||
|
void getOrderByIdSignalFull(OAIHttpRequestWorker* worker, OAIOrder summary);
|
||||||
|
void placeOrderSignalFull(OAIHttpRequestWorker* worker, OAIOrder summary);
|
||||||
|
|
||||||
void deleteOrderSignalE(QNetworkReply::NetworkError error_type, QString& error_str);
|
void deleteOrderSignalE(QNetworkReply::NetworkError error_type, QString& error_str);
|
||||||
void getInventorySignalE(QMap<QString, qint32> summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
void getInventorySignalE(QMap<QString, qint32> summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||||
void getOrderByIdSignalE(OAIOrder summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
void getOrderByIdSignalE(OAIOrder summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||||
|
@ -32,7 +32,7 @@ OAIUserApi::OAIUserApi(QString host, QString basePath) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
OAIUserApi::createUser(const OAIUser& oai_user) {
|
OAIUserApi::createUser(const OAIUser& body) {
|
||||||
QString fullPath;
|
QString fullPath;
|
||||||
fullPath.append(this->host).append(this->basePath).append("/user");
|
fullPath.append(this->host).append(this->basePath).append("/user");
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ OAIUserApi::createUser(const OAIUser& oai_user) {
|
|||||||
OAIHttpRequestInput input(fullPath, "POST");
|
OAIHttpRequestInput input(fullPath, "POST");
|
||||||
|
|
||||||
|
|
||||||
QString output = oai_user.asJson();
|
QString output = body.asJson();
|
||||||
input.request_body.append(output);
|
input.request_body.append(output);
|
||||||
|
|
||||||
|
|
||||||
@ -72,6 +72,7 @@ OAIUserApi::createUserCallback(OAIHttpRequestWorker * worker) {
|
|||||||
|
|
||||||
if (worker->error_type == QNetworkReply::NoError) {
|
if (worker->error_type == QNetworkReply::NoError) {
|
||||||
emit createUserSignal();
|
emit createUserSignal();
|
||||||
|
emit createUserSignalFull(worker);
|
||||||
} else {
|
} else {
|
||||||
emit createUserSignalE(error_type, error_str);
|
emit createUserSignalE(error_type, error_str);
|
||||||
emit createUserSignalEFull(worker, error_type, error_str);
|
emit createUserSignalEFull(worker, error_type, error_str);
|
||||||
@ -79,7 +80,7 @@ OAIUserApi::createUserCallback(OAIHttpRequestWorker * worker) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
OAIUserApi::createUsersWithArrayInput(const QList<OAIUser>& oai_user) {
|
OAIUserApi::createUsersWithArrayInput(const QList<OAIUser>& body) {
|
||||||
QString fullPath;
|
QString fullPath;
|
||||||
fullPath.append(this->host).append(this->basePath).append("/user/createWithArray");
|
fullPath.append(this->host).append(this->basePath).append("/user/createWithArray");
|
||||||
|
|
||||||
@ -87,7 +88,7 @@ OAIUserApi::createUsersWithArrayInput(const QList<OAIUser>& oai_user) {
|
|||||||
OAIHttpRequestInput input(fullPath, "POST");
|
OAIHttpRequestInput input(fullPath, "POST");
|
||||||
|
|
||||||
|
|
||||||
QJsonDocument doc(::OpenAPI::toJsonValue(oai_user).toArray());
|
QJsonDocument doc(::OpenAPI::toJsonValue(body).toArray());
|
||||||
QByteArray bytes = doc.toJson();
|
QByteArray bytes = doc.toJson();
|
||||||
input.request_body.append(bytes);
|
input.request_body.append(bytes);
|
||||||
|
|
||||||
@ -120,6 +121,7 @@ OAIUserApi::createUsersWithArrayInputCallback(OAIHttpRequestWorker * worker) {
|
|||||||
|
|
||||||
if (worker->error_type == QNetworkReply::NoError) {
|
if (worker->error_type == QNetworkReply::NoError) {
|
||||||
emit createUsersWithArrayInputSignal();
|
emit createUsersWithArrayInputSignal();
|
||||||
|
emit createUsersWithArrayInputSignalFull(worker);
|
||||||
} else {
|
} else {
|
||||||
emit createUsersWithArrayInputSignalE(error_type, error_str);
|
emit createUsersWithArrayInputSignalE(error_type, error_str);
|
||||||
emit createUsersWithArrayInputSignalEFull(worker, error_type, error_str);
|
emit createUsersWithArrayInputSignalEFull(worker, error_type, error_str);
|
||||||
@ -127,7 +129,7 @@ OAIUserApi::createUsersWithArrayInputCallback(OAIHttpRequestWorker * worker) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
OAIUserApi::createUsersWithListInput(const QList<OAIUser>& oai_user) {
|
OAIUserApi::createUsersWithListInput(const QList<OAIUser>& body) {
|
||||||
QString fullPath;
|
QString fullPath;
|
||||||
fullPath.append(this->host).append(this->basePath).append("/user/createWithList");
|
fullPath.append(this->host).append(this->basePath).append("/user/createWithList");
|
||||||
|
|
||||||
@ -135,7 +137,7 @@ OAIUserApi::createUsersWithListInput(const QList<OAIUser>& oai_user) {
|
|||||||
OAIHttpRequestInput input(fullPath, "POST");
|
OAIHttpRequestInput input(fullPath, "POST");
|
||||||
|
|
||||||
|
|
||||||
QJsonDocument doc(::OpenAPI::toJsonValue(oai_user).toArray());
|
QJsonDocument doc(::OpenAPI::toJsonValue(body).toArray());
|
||||||
QByteArray bytes = doc.toJson();
|
QByteArray bytes = doc.toJson();
|
||||||
input.request_body.append(bytes);
|
input.request_body.append(bytes);
|
||||||
|
|
||||||
@ -168,6 +170,7 @@ OAIUserApi::createUsersWithListInputCallback(OAIHttpRequestWorker * worker) {
|
|||||||
|
|
||||||
if (worker->error_type == QNetworkReply::NoError) {
|
if (worker->error_type == QNetworkReply::NoError) {
|
||||||
emit createUsersWithListInputSignal();
|
emit createUsersWithListInputSignal();
|
||||||
|
emit createUsersWithListInputSignalFull(worker);
|
||||||
} else {
|
} else {
|
||||||
emit createUsersWithListInputSignalE(error_type, error_str);
|
emit createUsersWithListInputSignalE(error_type, error_str);
|
||||||
emit createUsersWithListInputSignalEFull(worker, error_type, error_str);
|
emit createUsersWithListInputSignalEFull(worker, error_type, error_str);
|
||||||
@ -214,6 +217,7 @@ OAIUserApi::deleteUserCallback(OAIHttpRequestWorker * worker) {
|
|||||||
|
|
||||||
if (worker->error_type == QNetworkReply::NoError) {
|
if (worker->error_type == QNetworkReply::NoError) {
|
||||||
emit deleteUserSignal();
|
emit deleteUserSignal();
|
||||||
|
emit deleteUserSignalFull(worker);
|
||||||
} else {
|
} else {
|
||||||
emit deleteUserSignalE(error_type, error_str);
|
emit deleteUserSignalE(error_type, error_str);
|
||||||
emit deleteUserSignalEFull(worker, error_type, error_str);
|
emit deleteUserSignalEFull(worker, error_type, error_str);
|
||||||
@ -261,6 +265,7 @@ OAIUserApi::getUserByNameCallback(OAIHttpRequestWorker * worker) {
|
|||||||
|
|
||||||
if (worker->error_type == QNetworkReply::NoError) {
|
if (worker->error_type == QNetworkReply::NoError) {
|
||||||
emit getUserByNameSignal(output);
|
emit getUserByNameSignal(output);
|
||||||
|
emit getUserByNameSignalFull(worker, output);
|
||||||
} else {
|
} else {
|
||||||
emit getUserByNameSignalE(output, error_type, error_str);
|
emit getUserByNameSignalE(output, error_type, error_str);
|
||||||
emit getUserByNameSignalEFull(worker, error_type, error_str);
|
emit getUserByNameSignalEFull(worker, error_type, error_str);
|
||||||
@ -322,6 +327,7 @@ OAIUserApi::loginUserCallback(OAIHttpRequestWorker * worker) {
|
|||||||
|
|
||||||
if (worker->error_type == QNetworkReply::NoError) {
|
if (worker->error_type == QNetworkReply::NoError) {
|
||||||
emit loginUserSignal(output);
|
emit loginUserSignal(output);
|
||||||
|
emit loginUserSignalFull(worker, output);
|
||||||
} else {
|
} else {
|
||||||
emit loginUserSignalE(output, error_type, error_str);
|
emit loginUserSignalE(output, error_type, error_str);
|
||||||
emit loginUserSignalEFull(worker, error_type, error_str);
|
emit loginUserSignalEFull(worker, error_type, error_str);
|
||||||
@ -365,6 +371,7 @@ OAIUserApi::logoutUserCallback(OAIHttpRequestWorker * worker) {
|
|||||||
|
|
||||||
if (worker->error_type == QNetworkReply::NoError) {
|
if (worker->error_type == QNetworkReply::NoError) {
|
||||||
emit logoutUserSignal();
|
emit logoutUserSignal();
|
||||||
|
emit logoutUserSignalFull(worker);
|
||||||
} else {
|
} else {
|
||||||
emit logoutUserSignalE(error_type, error_str);
|
emit logoutUserSignalE(error_type, error_str);
|
||||||
emit logoutUserSignalEFull(worker, error_type, error_str);
|
emit logoutUserSignalEFull(worker, error_type, error_str);
|
||||||
@ -372,7 +379,7 @@ OAIUserApi::logoutUserCallback(OAIHttpRequestWorker * worker) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
OAIUserApi::updateUser(const QString& username, const OAIUser& oai_user) {
|
OAIUserApi::updateUser(const QString& username, const OAIUser& body) {
|
||||||
QString fullPath;
|
QString fullPath;
|
||||||
fullPath.append(this->host).append(this->basePath).append("/user/{username}");
|
fullPath.append(this->host).append(this->basePath).append("/user/{username}");
|
||||||
QString usernamePathParam("{");
|
QString usernamePathParam("{");
|
||||||
@ -383,7 +390,7 @@ OAIUserApi::updateUser(const QString& username, const OAIUser& oai_user) {
|
|||||||
OAIHttpRequestInput input(fullPath, "PUT");
|
OAIHttpRequestInput input(fullPath, "PUT");
|
||||||
|
|
||||||
|
|
||||||
QString output = oai_user.asJson();
|
QString output = body.asJson();
|
||||||
input.request_body.append(output);
|
input.request_body.append(output);
|
||||||
|
|
||||||
|
|
||||||
@ -415,6 +422,7 @@ OAIUserApi::updateUserCallback(OAIHttpRequestWorker * worker) {
|
|||||||
|
|
||||||
if (worker->error_type == QNetworkReply::NoError) {
|
if (worker->error_type == QNetworkReply::NoError) {
|
||||||
emit updateUserSignal();
|
emit updateUserSignal();
|
||||||
|
emit updateUserSignalFull(worker);
|
||||||
} else {
|
} else {
|
||||||
emit updateUserSignalE(error_type, error_str);
|
emit updateUserSignalE(error_type, error_str);
|
||||||
emit updateUserSignalEFull(worker, error_type, error_str);
|
emit updateUserSignalEFull(worker, error_type, error_str);
|
||||||
|
@ -35,14 +35,14 @@ public:
|
|||||||
QString basePath;
|
QString basePath;
|
||||||
QMap<QString, QString> defaultHeaders;
|
QMap<QString, QString> defaultHeaders;
|
||||||
|
|
||||||
void createUser(const OAIUser& oai_user);
|
void createUser(const OAIUser& body);
|
||||||
void createUsersWithArrayInput(const QList<OAIUser>& oai_user);
|
void createUsersWithArrayInput(const QList<OAIUser>& body);
|
||||||
void createUsersWithListInput(const QList<OAIUser>& oai_user);
|
void createUsersWithListInput(const QList<OAIUser>& body);
|
||||||
void deleteUser(const QString& username);
|
void deleteUser(const QString& username);
|
||||||
void getUserByName(const QString& username);
|
void getUserByName(const QString& username);
|
||||||
void loginUser(const QString& username, const QString& password);
|
void loginUser(const QString& username, const QString& password);
|
||||||
void logoutUser();
|
void logoutUser();
|
||||||
void updateUser(const QString& username, const OAIUser& oai_user);
|
void updateUser(const QString& username, const OAIUser& body);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void createUserCallback (OAIHttpRequestWorker * worker);
|
void createUserCallback (OAIHttpRequestWorker * worker);
|
||||||
@ -64,6 +64,15 @@ signals:
|
|||||||
void logoutUserSignal();
|
void logoutUserSignal();
|
||||||
void updateUserSignal();
|
void updateUserSignal();
|
||||||
|
|
||||||
|
void createUserSignalFull(OAIHttpRequestWorker* worker);
|
||||||
|
void createUsersWithArrayInputSignalFull(OAIHttpRequestWorker* worker);
|
||||||
|
void createUsersWithListInputSignalFull(OAIHttpRequestWorker* worker);
|
||||||
|
void deleteUserSignalFull(OAIHttpRequestWorker* worker);
|
||||||
|
void getUserByNameSignalFull(OAIHttpRequestWorker* worker, OAIUser summary);
|
||||||
|
void loginUserSignalFull(OAIHttpRequestWorker* worker, QString summary);
|
||||||
|
void logoutUserSignalFull(OAIHttpRequestWorker* worker);
|
||||||
|
void updateUserSignalFull(OAIHttpRequestWorker* worker);
|
||||||
|
|
||||||
void createUserSignalE(QNetworkReply::NetworkError error_type, QString& error_str);
|
void createUserSignalE(QNetworkReply::NetworkError error_type, QString& error_str);
|
||||||
void createUsersWithArrayInputSignalE(QNetworkReply::NetworkError error_type, QString& error_str);
|
void createUsersWithArrayInputSignalE(QNetworkReply::NetworkError error_type, QString& error_str);
|
||||||
void createUsersWithListInputSignalE(QNetworkReply::NetworkError error_type, QString& error_str);
|
void createUsersWithListInputSignalE(QNetworkReply::NetworkError error_type, QString& error_str);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user