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