|
|
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
|
|
|
|
part of 'business_api.dart';
|
|
|
|
|
|
|
|
// **************************************************************************
|
|
|
|
// RetrofitGenerator
|
|
|
|
// **************************************************************************
|
|
|
|
|
|
|
|
class _BusinessApiService implements BusinessApiService {
|
|
|
|
_BusinessApiService(this._dio, {this.baseUrl}) {
|
|
|
|
ArgumentError.checkNotNull(_dio, '_dio');
|
|
|
|
baseUrl ??= kReleaseMode ? serviceBaseUrl : localBaseUrl;
|
|
|
|
}
|
|
|
|
|
|
|
|
final Dio _dio;
|
|
|
|
|
|
|
|
String baseUrl;
|
|
|
|
|
|
|
|
@override
|
|
|
|
void dispose() {
|
|
|
|
_dio.close(force: true);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData> annoToken(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>>('anno/token',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
options: RequestOptions(
|
|
|
|
method: 'POST',
|
|
|
|
headers: <String, dynamic>{},
|
|
|
|
extra: _extra,
|
|
|
|
baseUrl: baseUrl),
|
|
|
|
data: _data);
|
|
|
|
final value = BaseData.fromJson(
|
|
|
|
_result.data,
|
|
|
|
(json) => json == null ? null : json,
|
|
|
|
);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<DayCount>> getDayCounts(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>>(
|
|
|
|
'comprehensiveReport/getDayCounts',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
options: RequestOptions(
|
|
|
|
method: 'POST',
|
|
|
|
headers: <String, dynamic>{},
|
|
|
|
extra: _extra,
|
|
|
|
baseUrl: baseUrl),
|
|
|
|
data: _data);
|
|
|
|
final value = BaseData<DayCount>.fromJson(
|
|
|
|
_result.data,
|
|
|
|
(json) => json == "" ? null : DayCount.fromJson(json),
|
|
|
|
);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<PopularSalesList>> popularList(offsetDay) async {
|
|
|
|
ArgumentError.checkNotNull(offsetDay, 'offsetDay');
|
|
|
|
const _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _data = <String, dynamic>{};
|
|
|
|
final _result = await _dio.request<Map<String, dynamic>>(
|
|
|
|
'dashBoard/store/?offsetDay=$offsetDay',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
options: RequestOptions(
|
|
|
|
method: 'GET',
|
|
|
|
headers: <String, dynamic>{},
|
|
|
|
extra: _extra,
|
|
|
|
baseUrl: baseUrl),
|
|
|
|
data: _data);
|
|
|
|
final value = BaseData<PopularSalesList>.fromJson(
|
|
|
|
_result.data,
|
|
|
|
(json) => PopularSalesList.fromJson(json),
|
|
|
|
);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<List<OrderTrend>>> orderTrend() async {
|
|
|
|
const _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _data = <String, dynamic>{};
|
|
|
|
final _result = await _dio.request<Map<String, dynamic>>('trend/orderTrend',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
options: RequestOptions(
|
|
|
|
method: 'GET',
|
|
|
|
headers: <String, dynamic>{},
|
|
|
|
extra: _extra,
|
|
|
|
baseUrl: baseUrl),
|
|
|
|
data: _data);
|
|
|
|
final value = BaseData<List<OrderTrend>>.fromJson(
|
|
|
|
_result.data,
|
|
|
|
(json) => (json as List<dynamic>)
|
|
|
|
.map<OrderTrend>(
|
|
|
|
(i) => OrderTrend.fromJson(i as Map<String, dynamic>))
|
|
|
|
.toList());
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<VipCountsInfo>> vipCounts(date) async {
|
|
|
|
ArgumentError.checkNotNull(date, 'date');
|
|
|
|
const _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _data = <String, dynamic>{};
|
|
|
|
final _result = await _dio.request<Map<String, dynamic>>(
|
|
|
|
'largeScreenReport/getDayCounts?date=$date',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
options: RequestOptions(
|
|
|
|
method: 'GET',
|
|
|
|
headers: <String, dynamic>{},
|
|
|
|
extra: _extra,
|
|
|
|
baseUrl: baseUrl),
|
|
|
|
data: _data);
|
|
|
|
final value = BaseData<VipCountsInfo>.fromJson(
|
|
|
|
_result.data,
|
|
|
|
(json) => VipCountsInfo.fromJson(json),
|
|
|
|
);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<List<DayFlowList>>> dayFlow(yearMonth, isMonth) async {
|
|
|
|
ArgumentError.checkNotNull(yearMonth, 'yearMonth');
|
|
|
|
ArgumentError.checkNotNull(isMonth, 'isMonth');
|
|
|
|
const _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _data = <String, dynamic>{};
|
|
|
|
final _result = await _dio.request<Map<String, dynamic>>(
|
|
|
|
'dashBoard/order?yearMonth=$yearMonth&isMonth=$isMonth',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
options: RequestOptions(
|
|
|
|
method: 'GET',
|
|
|
|
headers: <String, dynamic>{},
|
|
|
|
extra: _extra,
|
|
|
|
baseUrl: baseUrl),
|
|
|
|
data: _data);
|
|
|
|
final value = BaseData<List<DayFlowList>>.fromJson(
|
|
|
|
_result.data,
|
|
|
|
(json) => (json as List<dynamic>)
|
|
|
|
.map<DayFlowList>(
|
|
|
|
(i) => DayFlowList.fromJson(i as Map<String, dynamic>))
|
|
|
|
.toList());
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<List<SingleSalesList>>> singleSales(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>>(
|
|
|
|
'audit/salesLeaderboard',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
options: RequestOptions(
|
|
|
|
method: 'POST',
|
|
|
|
headers: <String, dynamic>{},
|
|
|
|
extra: _extra,
|
|
|
|
baseUrl: baseUrl),
|
|
|
|
data: _data);
|
|
|
|
final value = BaseData<List<SingleSalesList>>.fromJson(
|
|
|
|
_result.data,
|
|
|
|
(json) => (json as List<dynamic>)
|
|
|
|
.map<SingleSalesList>(
|
|
|
|
(i) => SingleSalesList.fromJson(i as Map<String, dynamic>))
|
|
|
|
.toList());
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<List<GoodsTypeSalesList>>> goodsSalesList(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>>(
|
|
|
|
'audit/allKindsSalesStatistics',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
options: RequestOptions(
|
|
|
|
method: 'POST',
|
|
|
|
headers: <String, dynamic>{},
|
|
|
|
extra: _extra,
|
|
|
|
baseUrl: baseUrl),
|
|
|
|
data: _data);
|
|
|
|
final value = BaseData<List<GoodsTypeSalesList>>.fromJson(
|
|
|
|
_result.data,
|
|
|
|
(json) => (json as List<dynamic>)
|
|
|
|
.map<GoodsTypeSalesList>(
|
|
|
|
(i) => GoodsTypeSalesList.fromJson(i as Map<String, dynamic>))
|
|
|
|
.toList());
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<TradeSummaryList>> saleBusinessAnalysis(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>>(
|
|
|
|
'largeScreenReport/saleBusinessAnalysis',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
options: RequestOptions(
|
|
|
|
method: 'POST',
|
|
|
|
headers: <String, dynamic>{},
|
|
|
|
extra: _extra,
|
|
|
|
baseUrl: baseUrl),
|
|
|
|
data: _data);
|
|
|
|
final value = BaseData<TradeSummaryList>.fromJson(
|
|
|
|
_result.data,
|
|
|
|
(json) => json == "" ? null : TradeSummaryList.fromJson(json),
|
|
|
|
);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<BusinessOrderList>> findAdminOrderList(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>>(
|
|
|
|
'order/findAdminOrderList',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
options: RequestOptions(
|
|
|
|
method: 'POST',
|
|
|
|
headers: <String, dynamic>{},
|
|
|
|
extra: _extra,
|
|
|
|
baseUrl: baseUrl),
|
|
|
|
data: _data);
|
|
|
|
final value = BaseData<BusinessOrderList>.fromJson(
|
|
|
|
_result.data,
|
|
|
|
(json) => json == "" ? null : BusinessOrderList.fromJson(json),
|
|
|
|
);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<BusinessOrderDetailInfo>> getAdminOrderDetail(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>>(
|
|
|
|
'order/getAdminOrderDetail',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
options: RequestOptions(
|
|
|
|
method: 'POST',
|
|
|
|
headers: <String, dynamic>{},
|
|
|
|
extra: _extra,
|
|
|
|
baseUrl: baseUrl),
|
|
|
|
data: _data);
|
|
|
|
final value = BaseData<BusinessOrderDetailInfo>.fromJson(
|
|
|
|
_result.data,
|
|
|
|
(json) => json == "" ? null : BusinessOrderDetailInfo.fromJson(json),
|
|
|
|
);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<RefundReasonList>> refundReason(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>>('reason/page',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
options: RequestOptions(
|
|
|
|
method: 'POST',
|
|
|
|
headers: <String, dynamic>{},
|
|
|
|
extra: _extra,
|
|
|
|
baseUrl: baseUrl),
|
|
|
|
data: _data);
|
|
|
|
final value = BaseData<RefundReasonList>.fromJson(
|
|
|
|
_result.data,
|
|
|
|
(json) => json == "" ? null : RefundReasonList.fromJson(json),
|
|
|
|
);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData> refundOrder(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>>(
|
|
|
|
'order/refundOrder',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
options: RequestOptions(
|
|
|
|
method: 'POST',
|
|
|
|
headers: <String, dynamic>{},
|
|
|
|
extra: _extra,
|
|
|
|
baseUrl: baseUrl),
|
|
|
|
data: _data);
|
|
|
|
final value = BaseData.fromJson(
|
|
|
|
_result.data,
|
|
|
|
(json) => json == null ? null : json,
|
|
|
|
);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<ProductGroupList>> productGroup(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>>(
|
|
|
|
'productGroup/page',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
options: RequestOptions(
|
|
|
|
method: 'POST',
|
|
|
|
headers: <String, dynamic>{},
|
|
|
|
extra: _extra,
|
|
|
|
baseUrl: baseUrl),
|
|
|
|
data: _data);
|
|
|
|
final value = BaseData<ProductGroupList>.fromJson(
|
|
|
|
_result.data,
|
|
|
|
(json) => json == "" ? null : ProductGroupList.fromJson(json),
|
|
|
|
);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<BusinessGoods>> findAdminProductLis(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>>(
|
|
|
|
'product/findAdminProductListNew',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
options: RequestOptions(
|
|
|
|
method: 'POST',
|
|
|
|
headers: <String, dynamic>{},
|
|
|
|
extra: _extra,
|
|
|
|
baseUrl: baseUrl),
|
|
|
|
data: _data);
|
|
|
|
final value = BaseData<BusinessGoods>.fromJson(
|
|
|
|
_result.data,
|
|
|
|
(json) => json == "" ? null : BusinessGoods.fromJson(json),
|
|
|
|
);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData> modifyPassword(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>>('user',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
options: RequestOptions(
|
|
|
|
method: 'PUT',
|
|
|
|
headers: <String, dynamic>{},
|
|
|
|
extra: _extra,
|
|
|
|
baseUrl: baseUrl),
|
|
|
|
data: _data);
|
|
|
|
final value = BaseData.fromJson(
|
|
|
|
_result.data,
|
|
|
|
(json) => json == null ? null : json,
|
|
|
|
);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData> goodsUpdate(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>>('product/putStatus',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
options: RequestOptions(
|
|
|
|
method: 'POST',
|
|
|
|
headers: <String, dynamic>{},
|
|
|
|
extra: _extra,
|
|
|
|
baseUrl: baseUrl),
|
|
|
|
data: _data);
|
|
|
|
final value = BaseData.fromJson(
|
|
|
|
_result.data,
|
|
|
|
(json) => json == null ? null : json,
|
|
|
|
);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData> delProduct(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>>('product/delProduct',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
options: RequestOptions(
|
|
|
|
method: 'POST',
|
|
|
|
headers: <String, dynamic>{},
|
|
|
|
extra: _extra,
|
|
|
|
baseUrl: baseUrl),
|
|
|
|
data: _data);
|
|
|
|
final value = BaseData.fromJson(
|
|
|
|
_result.data,
|
|
|
|
(json) => json == null ? null : json,
|
|
|
|
);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData> saveProductGroup(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>>('productGroup/saveProductGroup',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
options: RequestOptions(
|
|
|
|
method: 'POST',
|
|
|
|
headers: <String, dynamic>{},
|
|
|
|
extra: _extra,
|
|
|
|
baseUrl: baseUrl),
|
|
|
|
data: _data);
|
|
|
|
final value = BaseData.fromJson(
|
|
|
|
_result.data,
|
|
|
|
(json) => json == null ? null : json,
|
|
|
|
);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData> delProductCategory(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>>('productGroup/delProductCategory',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
options: RequestOptions(
|
|
|
|
method: 'POST',
|
|
|
|
headers: <String, dynamic>{},
|
|
|
|
extra: _extra,
|
|
|
|
baseUrl: baseUrl),
|
|
|
|
data: _data);
|
|
|
|
final value = BaseData.fromJson(
|
|
|
|
_result.data,
|
|
|
|
(json) => json == null ? null : json,
|
|
|
|
);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<BusinessStoreList>> getStoreList(tenantCode,pageIndex,pageSize) async {
|
|
|
|
ArgumentError.checkNotNull(tenantCode, 'tenantCode');
|
|
|
|
ArgumentError.checkNotNull(pageIndex, 'pageIndex');
|
|
|
|
ArgumentError.checkNotNull(pageSize, 'pageSize');
|
|
|
|
const _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _data = <String, dynamic>{};
|
|
|
|
final _result = await _dio.request<Map<String, dynamic>>(
|
|
|
|
'store/getStoreList?tenantCode=$tenantCode&pageIndex=$pageIndex&pageSize=$pageSize',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
options: RequestOptions(
|
|
|
|
method: 'GET',
|
|
|
|
headers: <String, dynamic>{},
|
|
|
|
extra: _extra,
|
|
|
|
baseUrl: baseUrl),
|
|
|
|
data: _data);
|
|
|
|
final value = BaseData<BusinessStoreList>.fromJson(
|
|
|
|
_result.data,
|
|
|
|
(json) => BusinessStoreList.fromJson(json),
|
|
|
|
);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData> saveStoreInfo(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>>('store',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
options: RequestOptions(
|
|
|
|
method: 'PUT',
|
|
|
|
headers: <String, dynamic>{},
|
|
|
|
extra: _extra,
|
|
|
|
baseUrl: baseUrl),
|
|
|
|
data: _data);
|
|
|
|
final value = BaseData.fromJson(
|
|
|
|
_result.data,
|
|
|
|
(json) => json == null ? null : json,
|
|
|
|
);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<BaseData<UploadResult>> upload(data, folderId) async {
|
|
|
|
ArgumentError.checkNotNull(data, 'data');
|
|
|
|
ArgumentError.checkNotNull(folderId, 'folderId');
|
|
|
|
const _extra = <String, dynamic>{};
|
|
|
|
final queryParameters = <String, dynamic>{};
|
|
|
|
final _data = FormData();
|
|
|
|
String fileName = data.path.split(Platform.pathSeparator).last;
|
|
|
|
_data.files.add(MapEntry(
|
|
|
|
'file', MultipartFile.fromFileSync(data.path, filename: fileName)));
|
|
|
|
print("filename:$fileName");
|
|
|
|
if (folderId != null) {
|
|
|
|
_data.fields.add(MapEntry('folderId', folderId.toString()));
|
|
|
|
}
|
|
|
|
final _result = await _dio.request<Map<String, dynamic>>('/file/upload',
|
|
|
|
queryParameters: queryParameters,
|
|
|
|
options: RequestOptions(
|
|
|
|
method: 'POST',
|
|
|
|
headers: <String, dynamic>{},
|
|
|
|
extra: _extra,
|
|
|
|
connectTimeout: 60000,
|
|
|
|
baseUrl: baseUrl),
|
|
|
|
data: _data);
|
|
|
|
final value = BaseData<UploadResult>.fromJson(
|
|
|
|
_result.data,
|
|
|
|
(json) => UploadResult.fromJson(json),
|
|
|
|
);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
}
|