Compare commits

..

No commits in common. "2e7ae3fc70d3274e515a588adf643d0c60672cac" and "2241b0b02bd4f98b781196aeb15af8989851785b" have entirely different histories.

3 changed files with 1 additions and 41 deletions

View File

@ -350,11 +350,6 @@ class RetrofitApiGenerator extends BaseGenerator {
return 'BaseResult<void>';
}
//
if (_isSimpleSuccessResponse(path)) {
return 'BaseResult';
}
// schema 使
// swagger
return 'BaseResult<Map<String, dynamic>>';
@ -1445,40 +1440,6 @@ class RetrofitApiGenerator extends BaseGenerator {
return false;
}
///
bool _isSimpleSuccessResponse(ApiPath path) {
// (200, 201, 202)
final successResponses = ['200', '201', '202'];
for (final statusCode in successResponses) {
final response = path.responses[statusCode];
if (response != null) {
// description content schema
final hasNoContent = response.content.isEmpty;
if (hasNoContent) {
//
final methodName = _generateSimpleMethodName(path);
final pathLower = path.path.toLowerCase();
if (methodName.contains('logOff') ||
methodName.contains('register') ||
methodName.contains('getUserLoginCode') ||
pathLower.contains('logoff') ||
pathLower.contains('register') ||
pathLower.contains('getuserlogincode') ||
methodName.contains('delete') ||
methodName.contains('remove') ||
methodName.contains('upload')) {
return true;
}
}
}
}
return false;
}
///
bool _needsPaginationImport(List<ApiPath> paths) {
for (final path in paths) {

View File

@ -1,7 +1,7 @@
name: swagger_generator_flutter
description: A Flutter project using generated API models
version: 2.0.1+3
version: 2.0.0+2
environment:
sdk: '>=3.0.0 <4.0.0'

View File

@ -1 +0,0 @@