fixed Api returnType [android-volley]

This commit is contained in:
Shyri Villar 2015-11-05 07:40:19 +01:00
parent c3679893df
commit 5c79c21f3c

View File

@ -1,6 +1,6 @@
package {{package}};
import {{invokerPackage}}.ApiException;
import {{invokerPackage}}.Responses;
import {{invokerPackage}}.ApiInvoker;
import {{invokerPackage}}.Pair;
@ -46,7 +46,7 @@ public class {{classname}} {
{{#allParams}} * @param {{paramName}} {{description}}
{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
*/
public void {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}, final {{#returnBaseType}}{{returnBaseType}}Responses.{{#returnContainer}}{{returnContainer}}{{/returnContainer}}{{returnBaseType}}Response{{/returnBaseType}}{{^returnBaseType}}Response.Listener<String>{{/returnBaseType}} responseListener) {
public void {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}, final {{#returnBaseType}}Responses.{{returnBaseType}}{{#isListContainer}}List{{/isListContainer}}Response{{/returnBaseType}}{{^returnBaseType}}Response.Listener<String>{{/returnBaseType}} responseListener) {
Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
{{#allParams}}{{#required}}
// verify the required parameter '{{paramName}}' is set
@ -105,7 +105,7 @@ public class {{classname}} {
@Override
public void onResponse(String response) {
try {
responseListener.onResponse((List<Phone>) ApiInvoker.deserialize(response, "array", Phone.class));
responseListener.onResponse({{returnType}}) ApiInvoker.deserialize(response, "array", Phone.class));
} catch (ApiException exception) {
//TODO onError
Log.d("ERROR", "error");