forked from loafle/openapi-generator-original
various api template fixes [android-volley]
This commit is contained in:
parent
b9abe2b51d
commit
7b811ad44b
@ -2,12 +2,16 @@ package {{package}};
|
||||
|
||||
import {{invokerPackage}}.Responses;
|
||||
import {{invokerPackage}}.ApiInvoker;
|
||||
import {{invokerPackage}}.ApiException;
|
||||
import {{invokerPackage}}.Pair;
|
||||
|
||||
import {{modelPackage}}.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.VolleyError;
|
||||
|
||||
{{#imports}}import {{import}};
|
||||
{{/imports}}
|
||||
|
||||
@ -46,7 +50,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}}Responses.{{returnBaseType}}{{#isListContainer}}List{{/isListContainer}}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, final Response.ErrorListener errorListener) {
|
||||
Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
|
||||
{{#allParams}}{{#required}}
|
||||
// verify the required parameter '{{paramName}}' is set
|
||||
@ -113,17 +117,14 @@ public class {{classname}} {
|
||||
{{/returnType}}
|
||||
} catch (ApiException exception) {
|
||||
//TODO onError
|
||||
Log.d("ERROR", "error");
|
||||
}
|
||||
}
|
||||
}, new Response.ErrorListener() {
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
//TODO onError
|
||||
Log.d("ERROR", "error");
|
||||
errorListener.onErrorResponse(error);
|
||||
}
|
||||
});
|
||||
);
|
||||
});
|
||||
} catch (ApiException ex) {
|
||||
//TODO onError
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user