services_respository.dart 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629
  1. import 'package:domain/constants/api_constants.dart';
  2. import 'package:domain/entity/garage_sale_history_entity.dart';
  3. import 'package:domain/entity/garage_sale_rent_detail_entity.dart';
  4. import 'package:domain/entity/garage_sale_rent_entity.dart';
  5. import 'package:domain/entity/myposts_sale_rent_entity.dart';
  6. import 'package:domain/entity/newsfeed_foryou_entity.dart';
  7. import 'package:domain/entity/newsfeed_news_entity.dart';
  8. import 'package:domain/entity/paid_service_detail_entity.dart';
  9. import 'package:domain/entity/paid_service_entity.dart';
  10. import 'package:domain/entity/paid_service_pay_success_info_entity.dart';
  11. import 'package:domain/entity/repair_service_entity.dart';
  12. import 'package:domain/entity/server_time.dart';
  13. import 'package:domain/entity/service_category_entity.dart';
  14. import 'package:domain/entity/service_time_period_entity.dart';
  15. import 'package:domain/entity/service_order_detail_entity.dart';
  16. import 'package:domain/entity/service_evaluate_list_entity.dart';
  17. import 'package:domain/entity/service_repair_detail_entity.dart';
  18. import 'package:plugin_platform/engine/toast/toast_engine.dart';
  19. import 'package:plugin_platform/platform_export.dart';
  20. import 'package:plugin_platform/http/dio_engine.dart';
  21. import 'package:plugin_platform/http/http_result.dart';
  22. import 'package:riverpod_annotation/riverpod_annotation.dart';
  23. import 'package:shared/utils/log_utils.dart';
  24. import 'package:shared/utils/util.dart';
  25. import 'package:flutter_riverpod/flutter_riverpod.dart';
  26. import 'package:plugin_basic/provider/http_provider/http_provider.dart';
  27. part 'services_respository.g.dart';
  28. @Riverpod(keepAlive: true)
  29. ServicesRespository servicesRespository(Ref ref) {
  30. final dioEngine = ref.watch(dioEngineProvider);
  31. return ServicesRespository(dioEngine: dioEngine);
  32. }
  33. /*
  34. * 数据仓库
  35. */
  36. class ServicesRespository {
  37. DioEngine dioEngine;
  38. ServicesRespository({required this.dioEngine});
  39. //服务 获取 分类 字典
  40. Future<HttpResult<Object>> fetchServiceCateGoryList(
  41. Map<String, dynamic>? data, {
  42. CancelToken? cancelToken,
  43. }) async {
  44. Map<String, dynamic> params = {};
  45. params = data!;
  46. Map<String, String> headers = {};
  47. headers["Content-Type"] = "application/x-www-form-urlencoded";
  48. headers["Accept"] = "application/x.yyjobs-api.v1+json";
  49. final result = await dioEngine.requestNetResult(
  50. // ApiConstants.apiServerTime, // api 地址
  51. '/api/v1/user/service/category/index', // api 地址
  52. params: params,
  53. headers: headers,
  54. method: HttpMethod.GET,
  55. isShowLoadingDialog: true,
  56. //是否展示默认的Loading弹窗
  57. networkDebounce: true,
  58. //是否防抖防止重复请求
  59. cancelToken: cancelToken,
  60. );
  61. //根据返回的结果,封装原始数据为Bean/Entity对象
  62. if (result.isSuccess) {
  63. //重新赋值data或list
  64. final listJson = result.getListJson();
  65. var listData = listJson!.map((e) => ServiceCategoryEntity.fromJson(e!)).toList();
  66. //重新赋值data或list
  67. return result.convert(list: listData);
  68. }else {
  69. if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
  70. ToastEngine.show("${result.errorMsg}");
  71. }
  72. }
  73. return result.convert();
  74. }
  75. // 付费服务 获取 列表
  76. Future<HttpResult<Object>> fetchPaidServiceDataList(
  77. Map<String, dynamic>? data, {
  78. CancelToken? cancelToken,
  79. }) async {
  80. Map<String, dynamic> params = {};
  81. params = data!;
  82. Map<String, String> headers = {};
  83. headers["Content-Type"] = "application/x-www-form-urlencoded";
  84. headers["Accept"] = "application/x.yyjobs-api.v1+json";
  85. final result = await dioEngine.requestNetResult(
  86. '/api/v1/user/service/paid-service/index', // api 地址
  87. params: params,
  88. headers: headers,
  89. method: HttpMethod.GET,
  90. isShowLoadingDialog: false,
  91. //是否展示默认的Loading弹窗
  92. networkDebounce: true,
  93. //是否防抖防止重复请求
  94. cancelToken: cancelToken,
  95. );
  96. //根据返回的结果,封装原始数据为Bean/Entity对象
  97. if (result.isSuccess) {
  98. //重新赋值data或list
  99. final json = result.getDataJson();
  100. var data = PaidServiceEntity.fromJson(json!);
  101. //重新赋值data或list
  102. return result.convert(data: data);
  103. } else {
  104. if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
  105. ToastEngine.show("${result.errorMsg}");
  106. }
  107. }
  108. return result.convert();
  109. }
  110. // 付费/维修 服务 列表 点赞/取消点赞
  111. Future<HttpResult<Object>> fetchServiceLiked(
  112. Map<String, dynamic>? data, {
  113. CancelToken? cancelToken,
  114. }) async {
  115. Map<String, dynamic> params = {};
  116. params = data!;
  117. Map<String, String> headers = {};
  118. // headers["Content-Type"] = "application/x-www-form-urlencoded";
  119. // headers["Accept"] = "application/x.yyjobs-api.v1+json";
  120. final result = await dioEngine.requestNetResult(
  121. // ApiConstants.apiServerTime, // api 地址
  122. '/api/v1/user/service/paid-service/liked', // api 地址
  123. params: params,
  124. headers: headers,
  125. method: HttpMethod.POST,
  126. isShowLoadingDialog: true,
  127. //是否展示默认的Loading弹窗
  128. networkDebounce: true,
  129. //是否防抖防止重复请求
  130. cancelToken: cancelToken,
  131. );
  132. //根据返回的结果,封装原始数据为Bean/Entity对象
  133. if (result.isSuccess) {
  134. //重新赋值data或list
  135. final json = result.getDataDynamic();
  136. //重新赋值data或list
  137. return result.convert(data: json);
  138. } else {
  139. if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
  140. ToastEngine.show("${result.errorMsg}");
  141. }
  142. }
  143. return result.convert();
  144. }
  145. // 提交评价
  146. Future<HttpResult<Object>> fetchPublishEvaluation(
  147. Map<String, dynamic>? data, {
  148. CancelToken? cancelToken,
  149. }) async {
  150. Map<String, dynamic> params = {};
  151. params = data!;
  152. Map<String, String> headers = {};
  153. headers["Content-Type"] = "application/x-www-form-urlencoded";
  154. headers["Accept"] = "application/x.yyjobs-api.v1+json";
  155. List<String> paths = data!["resources"] as List<String>;
  156. Map<String, String> files = {};
  157. if (paths != null && paths.isNotEmpty) {
  158. paths.asMap().forEach((index, path) {
  159. files["resources[$index]"] = path;
  160. });
  161. }
  162. // 删除 resources 属性
  163. params.remove("resources");
  164. final result = await dioEngine.requestNetResult(
  165. // ApiConstants.apiServerTime, // api 地址
  166. '/api/v1/user/service/evaluation/publish', // api 地址
  167. params: params,
  168. paths: files,
  169. headers: headers,
  170. method: HttpMethod.POST,
  171. isShowLoadingDialog: true,
  172. //是否展示默认的Loading弹窗
  173. networkDebounce: true,
  174. //是否防抖防止重复请求
  175. cancelToken: cancelToken,
  176. );
  177. //根据返回的结果,封装原始数据为Bean/Entity对象
  178. if (result.isSuccess) {
  179. //重新赋值data或list
  180. final json = result.getDataJson();
  181. // var data = NewsfeedForyouEntity.fromJson(json!);
  182. //重新赋值data或list
  183. return result.convert(data: json);
  184. } else {
  185. if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
  186. ToastEngine.show("${result.errorMsg}");
  187. }
  188. }
  189. return result.convert();
  190. }
  191. // 评价列表
  192. Future<HttpResult<Object>> fetchEvaluationDataList(
  193. Map<String, dynamic>? data, {
  194. CancelToken? cancelToken,
  195. }) async {
  196. Map<String, dynamic> params = {};
  197. params = data!;
  198. Map<String, String> headers = {};
  199. headers["Content-Type"] = "application/x-www-form-urlencoded";
  200. headers["Accept"] = "application/x.yyjobs-api.v1+json";
  201. final result = await dioEngine.requestNetResult(
  202. // ApiConstants.apiServerTime, // api 地址
  203. '/api/v1/user/service/evaluation/index', // api 地址
  204. params: params,
  205. headers: headers,
  206. method: HttpMethod.GET,
  207. isShowLoadingDialog: false,
  208. //是否展示默认的Loading弹窗
  209. networkDebounce: true,
  210. //是否防抖防止重复请求
  211. cancelToken: cancelToken,
  212. );
  213. //根据返回的结果,封装原始数据为Bean/Entity对象
  214. if (result.isSuccess) {
  215. //重新赋值data或list
  216. final json = result.getDataJson();
  217. var data = ServiceEvaluateListEntity.fromJson(json!);
  218. //重新赋值data或list
  219. return result.convert(data: data);
  220. } else {
  221. if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
  222. ToastEngine.show("${result.errorMsg}");
  223. }
  224. }
  225. return result.convert();
  226. }
  227. // 获取 付费服务 详情信息
  228. Future<HttpResult<Object>> fetchPaidServiceCleanDetailInfo(
  229. Map<String, dynamic>? data, {
  230. CancelToken? cancelToken,
  231. }) async {
  232. Map<String, dynamic> params = {};
  233. params = data!;
  234. Map<String, String> headers = {};
  235. // headers["Content-Type"] = "application/x-www-form-urlencoded";
  236. // headers["Accept"] = "application/x.yyjobs-api.v1+json";
  237. final result = await dioEngine.requestNetResult(
  238. '/api/v1/user/service/paid-service/detail', // api 地址
  239. params: params,
  240. headers: headers,
  241. method: HttpMethod.GET,
  242. isShowLoadingDialog: false,
  243. //是否展示默认的Loading弹窗
  244. networkDebounce: true,
  245. //是否防抖防止重复请求
  246. cancelToken: cancelToken,
  247. );
  248. //根据返回的结果,封装原始数据为Bean/Entity对象
  249. if (result.isSuccess) {
  250. //重新赋值data或list
  251. final json = result.getDataJson();
  252. var data = PaidServiceDetailEntity.fromJson(json!);
  253. //重新赋值data或list
  254. return result.convert(data: data);
  255. }else {
  256. if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
  257. ToastEngine.show("${result.errorMsg}");
  258. }
  259. }
  260. return result.convert();
  261. }
  262. // 获取 付费服务 时间段
  263. Future<HttpResult<Object>> fetchPaidServiceTimePeriod(
  264. Map<String, dynamic>? data, {
  265. CancelToken? cancelToken,
  266. }) async {
  267. Map<String, dynamic> params = {};
  268. params = data!;
  269. Map<String, String> headers = {};
  270. // headers["Content-Type"] = "application/x-www-form-urlencoded";
  271. // headers["Accept"] = "application/x.yyjobs-api.v1+json";
  272. final result = await dioEngine.requestNetResult(
  273. '/api/v1/user/service/paid-service/time-period', // api 地址
  274. params: params,
  275. headers: headers,
  276. method: HttpMethod.GET,
  277. isShowLoadingDialog: false, //是否展示默认的Loading弹窗
  278. networkDebounce: false, //是否防抖防止重复请求
  279. cancelToken: cancelToken,
  280. );
  281. //根据返回的结果,封装原始数据为Bean/Entity对象
  282. if (result.isSuccess) {
  283. //重新赋值data或list
  284. final list = result.getListJson();
  285. List<ServiceTimePeriodEntity> listEntity= list!.map((e)=>ServiceTimePeriodEntity.fromJson(e)).toList();
  286. //重新赋值data或list
  287. return result.convert(list: listEntity);
  288. }else {
  289. if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
  290. ToastEngine.show("${result.errorMsg}");
  291. }
  292. }
  293. return result.convert();
  294. }
  295. // 付费服务 下单
  296. Future<HttpResult<Object>> fetchPaidServiceBook(
  297. Map<String, dynamic>? data, {
  298. CancelToken? cancelToken,
  299. }) async {
  300. Map<String, dynamic> params = {};
  301. params = data!;
  302. Map<String, String> headers = {};
  303. headers["Content-Type"] = "application/x-www-form-urlencoded";
  304. headers["Accept"] = "application/x.yyjobs-api.v1+json";
  305. final result = await dioEngine.requestNetResult(
  306. // ApiConstants.apiServerTime, // api 地址
  307. '/api/v1/user/service/paid-service-order/book', // api 地址
  308. params: params,
  309. headers: headers,
  310. method: HttpMethod.POST,
  311. isShowLoadingDialog: true,
  312. //是否展示默认的Loading弹窗
  313. networkDebounce: true,
  314. //是否防抖防止重复请求
  315. cancelToken: cancelToken,
  316. );
  317. //根据返回的结果,封装原始数据为Bean/Entity对象
  318. if (result.isSuccess) {
  319. //重新赋值data或list
  320. final json = result.getDataJson();
  321. var data = PaidServicePaySuccessInfoEntity.fromJson(json!);
  322. //重新赋值data或list
  323. return result.convert(data: json);
  324. } else {
  325. if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
  326. ToastEngine.show("${result.errorMsg}");
  327. }
  328. }
  329. return result.convert();
  330. }
  331. // 付费服务 订单列表
  332. Future<HttpResult<GarageSaleHistoryEntity>> fetchPaidServiceOrderList({
  333. required String type,
  334. required int curPage,
  335. CancelToken? cancelToken,
  336. }) async {
  337. Map<String, String> params = {};
  338. params['type'] = type;
  339. params['page'] = curPage.toString();
  340. params['limit'] = "10";
  341. final result = await dioEngine.requestNetResult(
  342. '/api/v1/user/service/paid-service-order/index',
  343. params: params,
  344. method: HttpMethod.GET,
  345. isShowLoadingDialog: false,
  346. //是否展示默认的Loading弹窗
  347. networkDebounce: true,
  348. //是否防抖防止重复请求
  349. cancelToken: cancelToken,
  350. );
  351. if (result.isSuccess) {
  352. final json = result.getDataJson();
  353. var data = GarageSaleHistoryEntity.fromJson(json!);
  354. return result.convert<GarageSaleHistoryEntity>(data: data);
  355. }
  356. return result.convert();
  357. }
  358. // 获取 付费服务 订单详情
  359. Future<HttpResult<ServiceOrderDetailEntity>> fetchPaidServiceCleanOrderDetail({
  360. required String id,
  361. CancelToken? cancelToken,
  362. }) async {
  363. Map<String, dynamic> params = {};
  364. params['id'] = id;
  365. final result = await dioEngine.requestNetResult(
  366. '/api/v1/user/service/paid-service-order/detail',
  367. params: params,
  368. method: HttpMethod.GET,
  369. isShowLoadingDialog: false,
  370. //是否展示默认的Loading弹窗
  371. networkDebounce: true,
  372. //是否防抖防止重复请求
  373. cancelToken: cancelToken,
  374. );
  375. if (result.isSuccess) {
  376. final json = result.getDataJson();
  377. var data = ServiceOrderDetailEntity.fromJson(json!);
  378. return result.convert<ServiceOrderDetailEntity>(data: data);
  379. }
  380. return result.convert();
  381. }
  382. // 获取 付费订单实际需要支付的价格
  383. Future<HttpResult<Object>> fetchPaidServiceCleanOrderPrice(
  384. Map<String, dynamic>? data, {
  385. CancelToken? cancelToken,
  386. }) async {
  387. Map<String, dynamic> params = {};
  388. params = data!;
  389. Map<String, String> headers = {};
  390. // headers["Content-Type"] = "application/x-www-form-urlencoded";
  391. // headers["Accept"] = "application/x.yyjobs-api.v1+json";
  392. final result = await dioEngine.requestNetResult(
  393. // ApiConstants.apiServerTime, // api 地址
  394. '/api/v1/user/service/paid-service-order/price', // api 地址
  395. params: params,
  396. headers: headers,
  397. method: HttpMethod.GET,
  398. isShowLoadingDialog: false,
  399. //是否展示默认的Loading弹窗
  400. networkDebounce: true,
  401. //是否防抖防止重复请求
  402. cancelToken: cancelToken,
  403. );
  404. //根据返回的结果,封装原始数据为Bean/Entity对象
  405. if (result.isSuccess) {
  406. //重新赋值data或list
  407. final json = result.getDataJson();
  408. // var data = GarageSaleRentDetailEntity.fromJson(json!);
  409. //重新赋值data或list
  410. return result.convert(data: json);
  411. } else {
  412. if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
  413. ToastEngine.show("${result.errorMsg}");
  414. }
  415. }
  416. return result.convert();
  417. }
  418. // 付费服务 取消订单
  419. Future<HttpResult> fetchCancelPaidServiceOrder({
  420. required String? id,
  421. required String? reason,
  422. CancelToken? cancelToken,
  423. }) async {
  424. Map<String, String> params = {};
  425. params['id'] = id ?? "";
  426. params['cancel_reason'] = reason ?? "";
  427. final result = await dioEngine.requestNetResult(
  428. '/api/v1/user/service/paid-service-order/cancel',
  429. params: params,
  430. method: HttpMethod.POST,
  431. isShowLoadingDialog: true,
  432. networkDebounce: true,
  433. cancelToken: cancelToken,
  434. );
  435. if (result.isSuccess) {
  436. return result.convert();
  437. }
  438. return result.convert();
  439. }
  440. ///-------------------咨询类---------------------------------
  441. // 维修服务 列表
  442. Future<HttpResult<Object>> fetchRepairServiceList(
  443. Map<String, dynamic>? data, {
  444. CancelToken? cancelToken,
  445. }) async {
  446. Map<String, dynamic> params = {};
  447. params = data!;
  448. Map<String, String> headers = {};
  449. headers["Content-Type"] = "application/x-www-form-urlencoded";
  450. headers["Accept"] = "application/x.yyjobs-api.v1+json";
  451. final result = await dioEngine.requestNetResult(
  452. // ApiConstants.apiServerTime, // api 地址
  453. '/api/v1/user/service/inquiry-service/index', // api 地址
  454. params: params,
  455. headers: headers,
  456. method: HttpMethod.GET,
  457. isShowLoadingDialog: false,
  458. //是否展示默认的Loading弹窗
  459. networkDebounce: true,
  460. //是否防抖防止重复请求
  461. cancelToken: cancelToken,
  462. );
  463. //根据返回的结果,封装原始数据为Bean/Entity对象
  464. if (result.isSuccess) {
  465. //重新赋值data或list
  466. final json = result.getDataJson();
  467. var data = RepairServiceEntity.fromJson(json!);
  468. //重新赋值data或list
  469. return result.convert(data: data);
  470. } else {
  471. if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
  472. ToastEngine.show("${result.errorMsg}");
  473. }
  474. }
  475. return result.convert();
  476. }
  477. // 获取 repair 详情信息
  478. Future<HttpResult<Object>> fetchServiceRepairDetailInfo(
  479. Map<String, dynamic>? data, {
  480. CancelToken? cancelToken,
  481. }) async {
  482. Map<String, dynamic> params = {};
  483. params = data!;
  484. Map<String, String> headers = {};
  485. // headers["Content-Type"] = "application/x-www-form-urlencoded";
  486. // headers["Accept"] = "application/x.yyjobs-api.v1+json";
  487. final result = await dioEngine.requestNetResult(
  488. // ApiConstants.apiServerTime, // api 地址
  489. '/api/v1/user/service/inquiry-service/detail', // api 地址
  490. params: params,
  491. headers: headers,
  492. method: HttpMethod.GET,
  493. isShowLoadingDialog: false,
  494. //是否展示默认的Loading弹窗
  495. networkDebounce: true,
  496. //是否防抖防止重复请求
  497. cancelToken: cancelToken,
  498. );
  499. //根据返回的结果,封装原始数据为Bean/Entity对象
  500. if (result.isSuccess) {
  501. //重新赋值data或list
  502. final json = result.getDataJson();
  503. var data = ServiceRepairDetailEntity.fromJson(json!);
  504. //重新赋值data或list
  505. return result.convert(data: data);
  506. } else {
  507. if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
  508. ToastEngine.show("${result.errorMsg}");
  509. }
  510. }
  511. return result.convert();
  512. }
  513. // 维修服务 提交咨询
  514. Future<HttpResult<Object>> fetchRepairServiceSubmit(
  515. Map<String, dynamic>? data, {
  516. CancelToken? cancelToken,
  517. }) async {
  518. Map<String, dynamic> params = {};
  519. params = data!;
  520. Map<String, String> headers = {};
  521. headers["Content-Type"] = "application/x-www-form-urlencoded";
  522. headers["Accept"] = "application/x.yyjobs-api.v1+json";
  523. final result = await dioEngine.requestNetResult(
  524. // ApiConstants.apiServerTime, // api 地址
  525. '/api/v1/user/service/inquiry-service-order/submit', // api 地址
  526. params: params,
  527. headers: headers,
  528. method: HttpMethod.POST,
  529. isShowLoadingDialog: true,
  530. //是否展示默认的Loading弹窗
  531. networkDebounce: true,
  532. //是否防抖防止重复请求
  533. cancelToken: cancelToken,
  534. );
  535. //根据返回的结果,封装原始数据为Bean/Entity对象
  536. if (result.isSuccess) {
  537. //重新赋值data或list
  538. final json = result.getDataJson();
  539. // var data = NewsfeedForyouEntity.fromJson(json!);
  540. //重新赋值data或list
  541. return result.convert(data: json);
  542. } else {
  543. if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
  544. ToastEngine.show("${result.errorMsg}");
  545. }
  546. }
  547. return result.convert();
  548. }
  549. // 维修服务 订单列表
  550. Future<HttpResult<GarageSaleHistoryEntity>> fetchRepairServiceOrderList({
  551. required int status,
  552. required int curPage,
  553. CancelToken? cancelToken,
  554. }) async {
  555. Map<String, String> params = {};
  556. params['status'] = status.toString();
  557. params['page'] = curPage.toString();
  558. params['limit'] = "10";
  559. final result = await dioEngine.requestNetResult(
  560. '/api/v1/user/service/inquiry-service-order/index',
  561. params: params,
  562. method: HttpMethod.GET,
  563. isShowLoadingDialog: false,
  564. //是否展示默认的Loading弹窗
  565. networkDebounce: true,
  566. //是否防抖防止重复请求
  567. cancelToken: cancelToken,
  568. );
  569. if (result.isSuccess) {
  570. final json = result.getDataJson();
  571. var data = GarageSaleHistoryEntity.fromJson(json!);
  572. return result.convert<GarageSaleHistoryEntity>(data: data);
  573. }
  574. return result.convert();
  575. }
  576. }