fixed ordering

This commit is contained in:
Tony Tam
2015-05-16 00:45:42 -07:00
parent a2d2deeb0c
commit f4cbd88e2c
5 changed files with 101 additions and 86 deletions

View File

@@ -22,20 +22,11 @@ void
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("{{path}}");
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "{{httpMethod}}");
{{#pathParams}}
QString {{paramName}}PathParam("{"); {{paramName}}PathParam.append("{{paramName}}").append("}");
fullPath.replace({{paramName}}PathParam, stringValue({{paramName}}));
{{/pathParams}}
{{#formParams}}{{^isFile}}
if({{paramName}} != NULL) {
input.add_var("{{paramName}}", *{{paramName}});
}
{{/isFile}}{{/formParams}}
{{#queryParams}}
{{^collectionFormat}}
if(fullPath.indexOf("?") > 0)
@@ -91,6 +82,16 @@ void
{{/collectionFormat}}
{{/queryParams}}
HttpRequestWorker *worker = new HttpRequestWorker();
HttpRequestInput input(fullPath, "{{httpMethod}}");
{{#formParams}}{{^isFile}}
if({{paramName}} != NULL) {
input.add_var("{{paramName}}", *{{paramName}});
}
{{/isFile}}{{/formParams}}
{{#bodyParams}}
{{#isContainer}}
QJsonArray* {{paramName}}Array = new QJsonArray();
@@ -104,7 +105,6 @@ void
{{^isContainer}}
QString output = {{paramName}}.asJson();
input.request_body.append(output);
{{/isContainer}}{{/bodyParams}}
{{#headerParams}}