|
|
|
@ -54,12 +54,14 @@ class _UserApi implements UserApi { |
|
|
|
} |
|
|
|
|
|
|
|
@override |
|
|
|
Future<HttpResponse<BaseResponse<dynamic>>> getUserInfo() async { |
|
|
|
Future<HttpResponse<BaseResponse<UserBaseData>>> getBaseUserInfo( |
|
|
|
String userId, |
|
|
|
) async { |
|
|
|
final _extra = <String, dynamic>{}; |
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
final queryParameters = <String, dynamic>{r'userId': userId}; |
|
|
|
final _headers = <String, dynamic>{}; |
|
|
|
const Map<String, dynamic>? _data = null; |
|
|
|
final _options = _setStreamType<HttpResponse<BaseResponse<dynamic>>>( |
|
|
|
final _options = _setStreamType<HttpResponse<BaseResponse<UserBaseData>>>( |
|
|
|
Options(method: 'GET', headers: _headers, extra: _extra) |
|
|
|
.compose( |
|
|
|
_dio.options, |
|
|
|
@ -70,11 +72,11 @@ class _UserApi implements UserApi { |
|
|
|
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), |
|
|
|
); |
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options); |
|
|
|
late BaseResponse<dynamic> _value; |
|
|
|
late BaseResponse<UserBaseData> _value; |
|
|
|
try { |
|
|
|
_value = BaseResponse<dynamic>.fromJson( |
|
|
|
_value = BaseResponse<UserBaseData>.fromJson( |
|
|
|
_result.data!, |
|
|
|
(json) => json as dynamic, |
|
|
|
(json) => UserBaseData.fromJson(json as Map<String, dynamic>), |
|
|
|
); |
|
|
|
} on Object catch (e, s) { |
|
|
|
errorLogger?.logError(e, s, _options); |
|
|
|
|