forked from loafle/openapi-generator-original
Merge remote-tracking branch 'origin/master' into 2.3.0
This commit is contained in:
@@ -38,7 +38,7 @@ SWGUserApi::createUser(User body) {
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "POST");
|
||||
|
||||
|
||||
|
||||
QString output = body.asJson();
|
||||
input.request_body.append(output);
|
||||
|
||||
@@ -55,6 +55,9 @@ SWGUserApi::createUser(User body) {
|
||||
void
|
||||
SWGUserApi::createUserCallback(HttpRequestWorker * worker) {
|
||||
QString msg;
|
||||
QString error_str = worker->error_str;
|
||||
QNetworkReply::NetworkError error_type = worker->error_type;
|
||||
|
||||
if (worker->error_type == QNetworkReply::NoError) {
|
||||
msg = QString("Success! %1 bytes").arg(worker->response.length());
|
||||
}
|
||||
@@ -62,13 +65,12 @@ SWGUserApi::createUserCallback(HttpRequestWorker * worker) {
|
||||
msg = "Error: " + worker->error_str;
|
||||
}
|
||||
|
||||
|
||||
|
||||
worker->deleteLater();
|
||||
|
||||
|
||||
emit createUserSignal();
|
||||
emit createUserSignalE(error_type, error_str);
|
||||
}
|
||||
|
||||
void
|
||||
SWGUserApi::createUsersWithArrayInput(QList<User*>* body) {
|
||||
QString fullPath;
|
||||
@@ -79,7 +81,7 @@ SWGUserApi::createUsersWithArrayInput(QList<User*>* body) {
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "POST");
|
||||
|
||||
|
||||
|
||||
QJsonArray* bodyArray = new QJsonArray();
|
||||
toJsonArray((QList<void*>*)body, bodyArray, QString("body"), QString("SWGUser*"));
|
||||
|
||||
@@ -101,6 +103,9 @@ SWGUserApi::createUsersWithArrayInput(QList<User*>* body) {
|
||||
void
|
||||
SWGUserApi::createUsersWithArrayInputCallback(HttpRequestWorker * worker) {
|
||||
QString msg;
|
||||
QString error_str = worker->error_str;
|
||||
QNetworkReply::NetworkError error_type = worker->error_type;
|
||||
|
||||
if (worker->error_type == QNetworkReply::NoError) {
|
||||
msg = QString("Success! %1 bytes").arg(worker->response.length());
|
||||
}
|
||||
@@ -108,13 +113,12 @@ SWGUserApi::createUsersWithArrayInputCallback(HttpRequestWorker * worker) {
|
||||
msg = "Error: " + worker->error_str;
|
||||
}
|
||||
|
||||
|
||||
|
||||
worker->deleteLater();
|
||||
|
||||
|
||||
emit createUsersWithArrayInputSignal();
|
||||
emit createUsersWithArrayInputSignalE(error_type, error_str);
|
||||
}
|
||||
|
||||
void
|
||||
SWGUserApi::createUsersWithListInput(QList<User*>* body) {
|
||||
QString fullPath;
|
||||
@@ -125,7 +129,7 @@ SWGUserApi::createUsersWithListInput(QList<User*>* body) {
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "POST");
|
||||
|
||||
|
||||
|
||||
QJsonArray* bodyArray = new QJsonArray();
|
||||
toJsonArray((QList<void*>*)body, bodyArray, QString("body"), QString("SWGUser*"));
|
||||
|
||||
@@ -147,6 +151,9 @@ SWGUserApi::createUsersWithListInput(QList<User*>* body) {
|
||||
void
|
||||
SWGUserApi::createUsersWithListInputCallback(HttpRequestWorker * worker) {
|
||||
QString msg;
|
||||
QString error_str = worker->error_str;
|
||||
QNetworkReply::NetworkError error_type = worker->error_type;
|
||||
|
||||
if (worker->error_type == QNetworkReply::NoError) {
|
||||
msg = QString("Success! %1 bytes").arg(worker->response.length());
|
||||
}
|
||||
@@ -154,13 +161,12 @@ SWGUserApi::createUsersWithListInputCallback(HttpRequestWorker * worker) {
|
||||
msg = "Error: " + worker->error_str;
|
||||
}
|
||||
|
||||
|
||||
|
||||
worker->deleteLater();
|
||||
|
||||
|
||||
emit createUsersWithListInputSignal();
|
||||
emit createUsersWithListInputSignalE(error_type, error_str);
|
||||
}
|
||||
|
||||
void
|
||||
SWGUserApi::deleteUser(QString* username) {
|
||||
QString fullPath;
|
||||
@@ -173,7 +179,7 @@ SWGUserApi::deleteUser(QString* username) {
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "DELETE");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -188,6 +194,9 @@ SWGUserApi::deleteUser(QString* username) {
|
||||
void
|
||||
SWGUserApi::deleteUserCallback(HttpRequestWorker * worker) {
|
||||
QString msg;
|
||||
QString error_str = worker->error_str;
|
||||
QNetworkReply::NetworkError error_type = worker->error_type;
|
||||
|
||||
if (worker->error_type == QNetworkReply::NoError) {
|
||||
msg = QString("Success! %1 bytes").arg(worker->response.length());
|
||||
}
|
||||
@@ -195,13 +204,12 @@ SWGUserApi::deleteUserCallback(HttpRequestWorker * worker) {
|
||||
msg = "Error: " + worker->error_str;
|
||||
}
|
||||
|
||||
|
||||
|
||||
worker->deleteLater();
|
||||
|
||||
|
||||
emit deleteUserSignal();
|
||||
emit deleteUserSignalE(error_type, error_str);
|
||||
}
|
||||
|
||||
void
|
||||
SWGUserApi::getUserByName(QString* username) {
|
||||
QString fullPath;
|
||||
@@ -214,7 +222,7 @@ SWGUserApi::getUserByName(QString* username) {
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "GET");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -229,6 +237,9 @@ SWGUserApi::getUserByName(QString* username) {
|
||||
void
|
||||
SWGUserApi::getUserByNameCallback(HttpRequestWorker * worker) {
|
||||
QString msg;
|
||||
QString error_str = worker->error_str;
|
||||
QNetworkReply::NetworkError error_type = worker->error_type;
|
||||
|
||||
if (worker->error_type == QNetworkReply::NoError) {
|
||||
msg = QString("Success! %1 bytes").arg(worker->response.length());
|
||||
}
|
||||
@@ -236,16 +247,15 @@ SWGUserApi::getUserByNameCallback(HttpRequestWorker * worker) {
|
||||
msg = "Error: " + worker->error_str;
|
||||
}
|
||||
|
||||
|
||||
QString json(worker->response);
|
||||
User* output = static_cast<User*>(create(json, QString("User")));
|
||||
|
||||
|
||||
QString json(worker->response);
|
||||
User* output = static_cast<User*>(create(json, QString("User")));
|
||||
worker->deleteLater();
|
||||
|
||||
emit getUserByNameSignal(output);
|
||||
|
||||
emit getUserByNameSignalE(output, error_type, error_str);
|
||||
}
|
||||
|
||||
void
|
||||
SWGUserApi::loginUser(QString* username, QString* password) {
|
||||
QString fullPath;
|
||||
@@ -272,7 +282,7 @@ SWGUserApi::loginUser(QString* username, QString* password) {
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "GET");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -287,6 +297,9 @@ SWGUserApi::loginUser(QString* username, QString* password) {
|
||||
void
|
||||
SWGUserApi::loginUserCallback(HttpRequestWorker * worker) {
|
||||
QString msg;
|
||||
QString error_str = worker->error_str;
|
||||
QNetworkReply::NetworkError error_type = worker->error_type;
|
||||
|
||||
if (worker->error_type == QNetworkReply::NoError) {
|
||||
msg = QString("Success! %1 bytes").arg(worker->response.length());
|
||||
}
|
||||
@@ -294,16 +307,15 @@ SWGUserApi::loginUserCallback(HttpRequestWorker * worker) {
|
||||
msg = "Error: " + worker->error_str;
|
||||
}
|
||||
|
||||
|
||||
QString json(worker->response);
|
||||
QString* output = static_cast<QString*>(create(json, QString("QString")));
|
||||
|
||||
|
||||
QString json(worker->response);
|
||||
QString* output = static_cast<QString*>(create(json, QString("QString")));
|
||||
worker->deleteLater();
|
||||
|
||||
emit loginUserSignal(output);
|
||||
|
||||
emit loginUserSignalE(output, error_type, error_str);
|
||||
}
|
||||
|
||||
void
|
||||
SWGUserApi::logoutUser() {
|
||||
QString fullPath;
|
||||
@@ -314,7 +326,7 @@ SWGUserApi::logoutUser() {
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "GET");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -329,6 +341,9 @@ SWGUserApi::logoutUser() {
|
||||
void
|
||||
SWGUserApi::logoutUserCallback(HttpRequestWorker * worker) {
|
||||
QString msg;
|
||||
QString error_str = worker->error_str;
|
||||
QNetworkReply::NetworkError error_type = worker->error_type;
|
||||
|
||||
if (worker->error_type == QNetworkReply::NoError) {
|
||||
msg = QString("Success! %1 bytes").arg(worker->response.length());
|
||||
}
|
||||
@@ -336,13 +351,12 @@ SWGUserApi::logoutUserCallback(HttpRequestWorker * worker) {
|
||||
msg = "Error: " + worker->error_str;
|
||||
}
|
||||
|
||||
|
||||
|
||||
worker->deleteLater();
|
||||
|
||||
|
||||
emit logoutUserSignal();
|
||||
emit logoutUserSignalE(error_type, error_str);
|
||||
}
|
||||
|
||||
void
|
||||
SWGUserApi::updateUser(QString* username, User body) {
|
||||
QString fullPath;
|
||||
@@ -355,7 +369,7 @@ SWGUserApi::updateUser(QString* username, User body) {
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "PUT");
|
||||
|
||||
|
||||
|
||||
QString output = body.asJson();
|
||||
input.request_body.append(output);
|
||||
|
||||
@@ -372,6 +386,9 @@ SWGUserApi::updateUser(QString* username, User body) {
|
||||
void
|
||||
SWGUserApi::updateUserCallback(HttpRequestWorker * worker) {
|
||||
QString msg;
|
||||
QString error_str = worker->error_str;
|
||||
QNetworkReply::NetworkError error_type = worker->error_type;
|
||||
|
||||
if (worker->error_type == QNetworkReply::NoError) {
|
||||
msg = QString("Success! %1 bytes").arg(worker->response.length());
|
||||
}
|
||||
@@ -379,12 +396,11 @@ SWGUserApi::updateUserCallback(HttpRequestWorker * worker) {
|
||||
msg = "Error: " + worker->error_str;
|
||||
}
|
||||
|
||||
|
||||
|
||||
worker->deleteLater();
|
||||
|
||||
|
||||
emit updateUserSignal();
|
||||
emit updateUserSignalE(error_type, error_str);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user