|
|
|
@ -9,7 +9,7 @@ part of 'min_api.dart';
|
|
|
|
|
class _MinApiService implements MinApiService { |
|
|
|
|
_MinApiService(this._dio, {this.baseUrl}) { |
|
|
|
|
ArgumentError.checkNotNull(_dio, '_dio'); |
|
|
|
|
baseUrl ??= 'http://192.168.10.142:8765/app/'; |
|
|
|
|
baseUrl ??= 'http://192.168.10.88:8765/app/'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
final Dio _dio; |
|
|
|
@ -176,13 +176,14 @@ class _MinApiService implements MinApiService {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
Future<BaseData<dynamic>> shoppingCartSingle(param) async { |
|
|
|
|
Future<BaseData<List<ShoppingCart>>> shoppingCartSingle(param) async { |
|
|
|
|
ArgumentError.checkNotNull(param, 'param'); |
|
|
|
|
const _extra = <String, dynamic>{}; |
|
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
|
final _data = <String, dynamic>{}; |
|
|
|
|
_data.addAll(param ?? <String, dynamic>{}); |
|
|
|
|
final _result = await _dio.request<Map<String, dynamic>>('shoppingcart/single', |
|
|
|
|
final _result = await _dio.request<Map<String, dynamic>>( |
|
|
|
|
'shoppingcart/single', |
|
|
|
|
queryParameters: queryParameters, |
|
|
|
|
options: RequestOptions( |
|
|
|
|
method: 'PUT', |
|
|
|
@ -190,14 +191,15 @@ class _MinApiService implements MinApiService {
|
|
|
|
|
extra: _extra, |
|
|
|
|
baseUrl: baseUrl), |
|
|
|
|
data: _data); |
|
|
|
|
final value = BaseData<dynamic>.fromJson( |
|
|
|
|
final value = BaseData<List<ShoppingCart>>.fromJson( |
|
|
|
|
_result.data, |
|
|
|
|
(json) => json as dynamic, |
|
|
|
|
); |
|
|
|
|
(json) => (json as List<dynamic>) |
|
|
|
|
.map<ShoppingCart>( |
|
|
|
|
(i) => ShoppingCart.fromJson(i as Map<String, dynamic>)) |
|
|
|
|
.toList()); |
|
|
|
|
return value; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
Future<BaseData<SettleOrderInfo>> getOrderInfo(param) async { |
|
|
|
|
ArgumentError.checkNotNull(param, 'param'); |
|
|
|
|