|
|
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
|
|
|
|
part of 'min_api.dart';
|
|
|
|
|
|
|
|
// **************************************************************************
|
|
|
|
// RetrofitGenerator
|
|
|
|
// **************************************************************************
|
|
|
|
|
|
|
|
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element
|
|
|
|
|
|
|
|
class _MinApiService implements MinApiService {
|
|
|
|
_MinApiService(
|
|
|
|
this._dio, {
|
|
|
|
this.baseUrl,
|
|
|
|
this.errorLogger,
|
|
|
|
}) {
|
|
|
|
baseUrl ??= serviceMiniBaseUrl;
|
|
|
|
}
|
|
|
|
|
|
|
|
final Dio _dio;
|
|
|
|
|
|
|
|
String? baseUrl;
|
|
|
|
|
|
|
|
final ParseErrorLogger? errorLogger;
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<dynamic>> memberInfo() async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
const Map<String, dynamic>? _data = null;
|
|
|
|
final _options = _setStreamType<BaseData<dynamic>>(Options(
|
|
|
|
method: 'GET',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'/member/info',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseData<dynamic> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseData<dynamic>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => json as dynamic,
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseListData<FindMiniGroup>> findMiNiGroupList(
|
|
|
|
Map<String, dynamic> param) async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
final _data = <String, dynamic>{};
|
|
|
|
_data.addAll(param);
|
|
|
|
final _options = _setStreamType<BaseListData<FindMiniGroup>>(Options(
|
|
|
|
method: 'POST',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'product/findMiNiGroupList',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseListData<FindMiniGroup> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseListData<FindMiniGroup>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => FindMiniGroup.fromJson(json as Map<String, dynamic>),
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<MiniDetail>> miNiDetail(String id) async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
const Map<String, dynamic>? _data = null;
|
|
|
|
final _options = _setStreamType<BaseData<MiniDetail>>(Options(
|
|
|
|
method: 'GET',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'/product/queryMiNiProductDetail?id=${id}',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseData<MiniDetail> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseData<MiniDetail>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => MiniDetail.fromJson(json as Map<String, dynamic>),
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseListData<ShoppingCart>> addShoppingCart(
|
|
|
|
Map<String, dynamic> param) async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
final _data = <String, dynamic>{};
|
|
|
|
_data.addAll(param);
|
|
|
|
final _options = _setStreamType<BaseListData<ShoppingCart>>(Options(
|
|
|
|
method: 'POST',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'shoppingcart',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseListData<ShoppingCart> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseListData<ShoppingCart>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => ShoppingCart.fromJson(json as Map<String, dynamic>),
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseListData<ShoppingCart>> getShoppingCart(int tableId) async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{r'tableId': tableId};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
const Map<String, dynamic>? _data = null;
|
|
|
|
final _options = _setStreamType<BaseListData<ShoppingCart>>(Options(
|
|
|
|
method: 'GET',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'shoppingcart',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseListData<ShoppingCart> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseListData<ShoppingCart>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => ShoppingCart.fromJson(json as Map<String, dynamic>),
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<bool>> clearShoppingCart(num storeId) async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{r'storeId': storeId};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
const Map<String, dynamic>? _data = null;
|
|
|
|
final _options = _setStreamType<BaseData<bool>>(Options(
|
|
|
|
method: 'GET',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'shoppingcart/delCart',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseData<bool> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseData<bool>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => json as bool,
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseListData<ShoppingCart>> shoppingCart1(
|
|
|
|
Map<String, dynamic> param) async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
final _data = <String, dynamic>{};
|
|
|
|
_data.addAll(param);
|
|
|
|
final _options = _setStreamType<BaseListData<ShoppingCart>>(Options(
|
|
|
|
method: 'PUT',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'shoppingcart',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseListData<ShoppingCart> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseListData<ShoppingCart>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => ShoppingCart.fromJson(json as Map<String, dynamic>),
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseListData<ShoppingCart>> shoppingCartSingle(
|
|
|
|
Map<String, dynamic> param) async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
final _data = <String, dynamic>{};
|
|
|
|
_data.addAll(param);
|
|
|
|
final _options = _setStreamType<BaseListData<ShoppingCart>>(Options(
|
|
|
|
method: 'PUT',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'shoppingcart/single',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseListData<ShoppingCart> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseListData<ShoppingCart>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => ShoppingCart.fromJson(json as Map<String, dynamic>),
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<SettleOrderInfo>> getOrderInfo(
|
|
|
|
Map<String, dynamic> param) async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
final _data = <String, dynamic>{};
|
|
|
|
_data.addAll(param);
|
|
|
|
final _options = _setStreamType<BaseData<SettleOrderInfo>>(Options(
|
|
|
|
method: 'POST',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'order/getOrderInfo',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseData<SettleOrderInfo> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseData<SettleOrderInfo>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => SettleOrderInfo.fromJson(json as Map<String, dynamic>),
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<MinOrderInfo>> getOrderDetails(
|
|
|
|
Map<String, dynamic> param) async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
final _data = <String, dynamic>{};
|
|
|
|
_data.addAll(param);
|
|
|
|
final _options = _setStreamType<BaseData<MinOrderInfo>>(Options(
|
|
|
|
method: 'POST',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'order/getOrderDetail',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseData<MinOrderInfo> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseData<MinOrderInfo>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => MinOrderInfo.fromJson(json as Map<String, dynamic>),
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseListData<Address>> queryAddress() async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
const Map<String, dynamic>? _data = null;
|
|
|
|
final _options = _setStreamType<BaseListData<Address>>(Options(
|
|
|
|
method: 'GET',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'address/queryMemberAddress',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseListData<Address> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseListData<Address>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => Address.fromJson(json as Map<String, dynamic>),
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<dynamic>> placeOrderFirst(Map<String, dynamic> param) async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
final _data = <String, dynamic>{};
|
|
|
|
_data.addAll(param);
|
|
|
|
final _options = _setStreamType<BaseData<dynamic>>(Options(
|
|
|
|
method: 'POST',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'order/placeOrderFirst',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseData<dynamic> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseData<dynamic>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => json as dynamic,
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<dynamic>> addOrder(Map<String, dynamic> param) async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
final _data = <String, dynamic>{};
|
|
|
|
_data.addAll(param);
|
|
|
|
final _options = _setStreamType<BaseData<dynamic>>(Options(
|
|
|
|
method: 'POST',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'order/addOrder',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseData<dynamic> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseData<dynamic>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => json as dynamic,
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<WxPay>> settlementWx(Map<String, dynamic> param) async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
final _data = <String, dynamic>{};
|
|
|
|
_data.addAll(param);
|
|
|
|
final _options = _setStreamType<BaseData<WxPay>>(Options(
|
|
|
|
method: 'POST',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'order/settlement',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseData<WxPay> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseData<WxPay>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => WxPay.fromJson(json as Map<String, dynamic>),
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<dynamic>> settlementApi(Map<String, dynamic> param) async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
final _data = <String, dynamic>{};
|
|
|
|
_data.addAll(param);
|
|
|
|
final _options = _setStreamType<BaseData<dynamic>>(Options(
|
|
|
|
method: 'POST',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'order/settlement',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseData<dynamic> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseData<dynamic>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => json as dynamic,
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<StoreInfo>> queryStoreInfo1(
|
|
|
|
Map<String, dynamic> param) async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
final _data = <String, dynamic>{};
|
|
|
|
_data.addAll(param);
|
|
|
|
final _options = _setStreamType<BaseData<StoreInfo>>(Options(
|
|
|
|
method: 'POST',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'store/getStore',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseData<StoreInfo> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseData<StoreInfo>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => StoreInfo.fromJson(json as Map<String, dynamic>),
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<dynamic>> getParentInfo(String tableId) async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
const Map<String, dynamic>? _data = null;
|
|
|
|
final _options = _setStreamType<BaseData<dynamic>>(Options(
|
|
|
|
method: 'GET',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'order/getParentInfo?tableId=${tableId}',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseData<dynamic> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseData<dynamic>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => json as dynamic,
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseListData<HomeRecommendList>> recommendList() async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
const Map<String, dynamic>? _data = null;
|
|
|
|
final _options = _setStreamType<BaseListData<HomeRecommendList>>(Options(
|
|
|
|
method: 'GET',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'product/recommendList',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseListData<HomeRecommendList> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseListData<HomeRecommendList>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => HomeRecommendList.fromJson(json as Map<String, dynamic>),
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<ShopingHomeConfig>> homeConfig() async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
const Map<String, dynamic>? _data = null;
|
|
|
|
final _options = _setStreamType<BaseData<ShopingHomeConfig>>(Options(
|
|
|
|
method: 'GET',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'store/homeConfig',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseData<ShopingHomeConfig> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseData<ShopingHomeConfig>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => ShopingHomeConfig.fromJson(json as Map<String, dynamic>),
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<ActivityAreaList>> findActListByType(
|
|
|
|
bool allDay,
|
|
|
|
String type,
|
|
|
|
) async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
const Map<String, dynamic>? _data = null;
|
|
|
|
final _options = _setStreamType<BaseData<ActivityAreaList>>(Options(
|
|
|
|
method: 'GET',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'actTemplate/findActListByType?allDay=${allDay}&type=${type}',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseData<ActivityAreaList> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseData<ActivityAreaList>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => ActivityAreaList.fromJson(json as Map<String, dynamic>),
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<ActivityDetails>> viewProduct(
|
|
|
|
String actProductId,
|
|
|
|
String type,
|
|
|
|
) async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
const Map<String, dynamic>? _data = null;
|
|
|
|
final _options = _setStreamType<BaseData<ActivityDetails>>(Options(
|
|
|
|
method: 'GET',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'actTemplate/viewProduct?actProductId=${actProductId}&type=${type}',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseData<ActivityDetails> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseData<ActivityDetails>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => ActivityDetails.fromJson(json as Map<String, dynamic>),
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<LaunchJoinAct>> launchAct(Map<String, dynamic> param) async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
final _data = <String, dynamic>{};
|
|
|
|
_data.addAll(param);
|
|
|
|
final _options = _setStreamType<BaseData<LaunchJoinAct>>(Options(
|
|
|
|
method: 'POST',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'actTemplate/launchAct',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseData<LaunchJoinAct> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseData<LaunchJoinAct>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => LaunchJoinAct.fromJson(json as Map<String, dynamic>),
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<LaunchJoinAct>> joinAct(Map<String, dynamic> param) async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
final _data = <String, dynamic>{};
|
|
|
|
_data.addAll(param);
|
|
|
|
final _options = _setStreamType<BaseData<LaunchJoinAct>>(Options(
|
|
|
|
method: 'POST',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'actTemplate/joinAct',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseData<LaunchJoinAct> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseData<LaunchJoinAct>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => LaunchJoinAct.fromJson(json as Map<String, dynamic>),
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<WxPay>?> actPay(Map<String, dynamic> param) async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
final _data = <String, dynamic>{};
|
|
|
|
_data.addAll(param);
|
|
|
|
final _options = _setStreamType<BaseData<WxPay>>(Options(
|
|
|
|
method: 'POST',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'actTemplate/actPay',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>?>(_options);
|
|
|
|
late BaseData<WxPay>? _value;
|
|
|
|
try {
|
|
|
|
_value = _result.data == null
|
|
|
|
? null
|
|
|
|
: BaseData<WxPay>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => WxPay.fromJson(json as Map<String, dynamic>),
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseListData<ActivityOrder>> showMyActList(
|
|
|
|
Map<String, dynamic> param) async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
final _data = <String, dynamic>{};
|
|
|
|
_data.addAll(param);
|
|
|
|
final _options = _setStreamType<BaseListData<ActivityOrder>>(Options(
|
|
|
|
method: 'POST',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'actTemplate/showMyActList',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseListData<ActivityOrder> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseListData<ActivityOrder>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => ActivityOrder.fromJson(json as Map<String, dynamic>),
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<ActivityActRecordDetails>> showOneAct(
|
|
|
|
String actRecordId) async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
const Map<String, dynamic>? _data = null;
|
|
|
|
final _options = _setStreamType<BaseData<ActivityActRecordDetails>>(Options(
|
|
|
|
method: 'GET',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'actTemplate/showOneAct?actRecordId=${actRecordId}',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseData<ActivityActRecordDetails> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseData<ActivityActRecordDetails>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) =>
|
|
|
|
ActivityActRecordDetails.fromJson(json as Map<String, dynamic>),
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<dynamic>> cancelMemberCoupon(String orderId) async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
const Map<String, dynamic>? _data = null;
|
|
|
|
final _options = _setStreamType<BaseData<dynamic>>(Options(
|
|
|
|
method: 'GET',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'promotion/cancelMemberCoupon?orderId=${orderId}',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseData<dynamic> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseData<dynamic>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => json as dynamic,
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<dynamic>> useMemberCoupon(Map<String, dynamic> param) async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
final _data = <String, dynamic>{};
|
|
|
|
_data.addAll(param);
|
|
|
|
final _options = _setStreamType<BaseData<dynamic>>(Options(
|
|
|
|
method: 'POST',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'promotion/useMemberCoupon',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseData<dynamic> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseData<dynamic>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => json as dynamic,
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<dynamic>> memberRecharge(Map<String, dynamic> param) async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
final _data = <String, dynamic>{};
|
|
|
|
_data.addAll(param);
|
|
|
|
final _options = _setStreamType<BaseData<dynamic>>(Options(
|
|
|
|
method: 'POST',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'/member/recharge',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseData<dynamic> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseData<dynamic>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => json as dynamic,
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseListData<MemberRecharge>> memberRechargeList() async {
|
|
|
|
final _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _headers = <String, dynamic>{};
|
|
|
|
const Map<String, dynamic>? _data = null;
|
|
|
|
final _options = _setStreamType<BaseListData<MemberRecharge>>(Options(
|
|
|
|
method: 'GET',
|
|
|
|
headers: _headers,
|
|
|
|
extra: _extra,
|
|
|
|
)
|
|
|
|
.compose(
|
|
|
|
_dio.options,
|
|
|
|
'/store/getRechargePreferential',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
data: _data,
|
|
|
|
)
|
|
|
|
.copyWith(
|
|
|
|
baseUrl: _combineBaseUrls(
|
|
|
|
_dio.options.baseUrl,
|
|
|
|
baseUrl,
|
|
|
|
)));
|
|
|
|
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
|
|
|
|
late BaseListData<MemberRecharge> _value;
|
|
|
|
try {
|
|
|
|
_value = BaseListData<MemberRecharge>.fromJson(
|
|
|
|
_result.data!,
|
|
|
|
(json) => MemberRecharge.fromJson(json as Map<String, dynamic>),
|
|
|
|
);
|
|
|
|
} on Object catch (e, s) {
|
|
|
|
errorLogger?.logError(e, s, _options);
|
|
|
|
rethrow;
|
|
|
|
}
|
|
|
|
return _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
|
|
|
|
if (T != dynamic &&
|
|
|
|
!(requestOptions.responseType == ResponseType.bytes ||
|
|
|
|
requestOptions.responseType == ResponseType.stream)) {
|
|
|
|
if (T == String) {
|
|
|
|
requestOptions.responseType = ResponseType.plain;
|
|
|
|
} else {
|
|
|
|
requestOptions.responseType = ResponseType.json;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return requestOptions;
|
|
|
|
}
|
|
|
|
|
|
|
|
String _combineBaseUrls(
|
|
|
|
String dioBaseUrl,
|
|
|
|
String? baseUrl,
|
|
|
|
) {
|
|
|
|
if (baseUrl == null || baseUrl.trim().isEmpty) {
|
|
|
|
return dioBaseUrl;
|
|
|
|
}
|
|
|
|
|
|
|
|
final url = Uri.parse(baseUrl);
|
|
|
|
|
|
|
|
if (url.isAbsolute) {
|
|
|
|
return url.toString();
|
|
|
|
}
|
|
|
|
|
|
|
|
return Uri.parse(dioBaseUrl).resolveUri(url).toString();
|
|
|
|
}
|
|
|
|
}
|