services_respository.dart 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  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. '/api/v1/user/service/like/click', // api 地址
  122. params: params,
  123. headers: headers,
  124. method: HttpMethod.POST,
  125. isShowLoadingDialog: true,
  126. //是否展示默认的Loading弹窗
  127. networkDebounce: true,
  128. //是否防抖防止重复请求
  129. cancelToken: cancelToken,
  130. );
  131. //根据返回的结果,封装原始数据为Bean/Entity对象
  132. if (result.isSuccess) {
  133. //重新赋值data或list
  134. final boolData = result.getDataDynamic();
  135. //重新赋值data或list
  136. return result.convert(data: boolData);
  137. } else {
  138. if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
  139. ToastEngine.show("${result.errorMsg}");
  140. }
  141. }
  142. return result.convert();
  143. }
  144. // 提交评价
  145. Future<HttpResult<Object>> fetchPublishEvaluation(
  146. Map<String, dynamic>? data, {
  147. CancelToken? cancelToken,
  148. }) async {
  149. Map<String, dynamic> params = {};
  150. params = data!;
  151. Map<String, String> headers = {};
  152. headers["Content-Type"] = "application/x-www-form-urlencoded";
  153. headers["Accept"] = "application/x.yyjobs-api.v1+json";
  154. List<String> paths = data!["resources"] as List<String>;
  155. Map<String, String> files = {};
  156. if (paths != null && paths.isNotEmpty) {
  157. paths.asMap().forEach((index, path) {
  158. files["resources[$index]"] = path;
  159. });
  160. }
  161. // 删除 resources 属性
  162. params.remove("resources");
  163. final result = await dioEngine.requestNetResult(
  164. // ApiConstants.apiServerTime, // api 地址
  165. '/api/v1/user/service/evaluation/publish', // api 地址
  166. params: params,
  167. paths: files,
  168. headers: headers,
  169. method: HttpMethod.POST,
  170. isShowLoadingDialog: true,
  171. //是否展示默认的Loading弹窗
  172. networkDebounce: true,
  173. //是否防抖防止重复请求
  174. cancelToken: cancelToken,
  175. );
  176. //根据返回的结果,封装原始数据为Bean/Entity对象
  177. if (result.isSuccess) {
  178. //重新赋值data或list
  179. final json = result.getDataJson();
  180. // var data = NewsfeedForyouEntity.fromJson(json!);
  181. //重新赋值data或list
  182. return result.convert(data: json);
  183. } else {
  184. if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
  185. ToastEngine.show("${result.errorMsg}");
  186. }
  187. }
  188. return result.convert();
  189. }
  190. // 评价列表
  191. Future<HttpResult<Object>> fetchEvaluationDataList(
  192. Map<String, dynamic>? data, {
  193. CancelToken? cancelToken,
  194. }) async {
  195. Map<String, dynamic> params = {};
  196. params = data!;
  197. Map<String, String> headers = {};
  198. headers["Content-Type"] = "application/x-www-form-urlencoded";
  199. headers["Accept"] = "application/x.yyjobs-api.v1+json";
  200. final result = await dioEngine.requestNetResult(
  201. // ApiConstants.apiServerTime, // api 地址
  202. '/api/v1/user/service/evaluation/index', // api 地址
  203. params: params,
  204. headers: headers,
  205. method: HttpMethod.GET,
  206. isShowLoadingDialog: false,
  207. //是否展示默认的Loading弹窗
  208. networkDebounce: true,
  209. //是否防抖防止重复请求
  210. cancelToken: cancelToken,
  211. );
  212. //根据返回的结果,封装原始数据为Bean/Entity对象
  213. if (result.isSuccess) {
  214. //重新赋值data或list
  215. final json = result.getDataJson();
  216. var data = ServiceEvaluateListEntity.fromJson(json!);
  217. //重新赋值data或list
  218. return result.convert(data: data);
  219. } else {
  220. if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
  221. ToastEngine.show("${result.errorMsg}");
  222. }
  223. }
  224. return result.convert();
  225. }
  226. // 获取 付费服务 详情信息
  227. Future<HttpResult<Object>> fetchPaidServiceCleanDetailInfo(
  228. Map<String, dynamic>? data, {
  229. CancelToken? cancelToken,
  230. }) async {
  231. Map<String, dynamic> params = {};
  232. params = data!;
  233. Map<String, String> headers = {};
  234. // headers["Content-Type"] = "application/x-www-form-urlencoded";
  235. // headers["Accept"] = "application/x.yyjobs-api.v1+json";
  236. final result = await dioEngine.requestNetResult(
  237. '/api/v1/user/service/paid-service/detail', // api 地址
  238. params: params,
  239. headers: headers,
  240. method: HttpMethod.GET,
  241. isShowLoadingDialog: false,
  242. //是否展示默认的Loading弹窗
  243. networkDebounce: true,
  244. //是否防抖防止重复请求
  245. cancelToken: cancelToken,
  246. );
  247. //根据返回的结果,封装原始数据为Bean/Entity对象
  248. if (result.isSuccess) {
  249. //重新赋值data或list
  250. final json = result.getDataJson();
  251. var data = PaidServiceDetailEntity.fromJson(json!);
  252. //重新赋值data或list
  253. return result.convert(data: data);
  254. }else {
  255. if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
  256. ToastEngine.show("${result.errorMsg}");
  257. }
  258. }
  259. return result.convert();
  260. }
  261. // 获取 付费服务 时间段
  262. Future<HttpResult<Object>> fetchPaidServiceTimePeriod(
  263. Map<String, dynamic>? data, {
  264. CancelToken? cancelToken,
  265. }) async {
  266. Map<String, dynamic> params = {};
  267. params = data!;
  268. Map<String, String> headers = {};
  269. // headers["Content-Type"] = "application/x-www-form-urlencoded";
  270. // headers["Accept"] = "application/x.yyjobs-api.v1+json";
  271. final result = await dioEngine.requestNetResult(
  272. '/api/v1/user/service/paid-service/time-period', // api 地址
  273. params: params,
  274. headers: headers,
  275. method: HttpMethod.GET,
  276. isShowLoadingDialog: false, //是否展示默认的Loading弹窗
  277. networkDebounce: false, //是否防抖防止重复请求
  278. cancelToken: cancelToken,
  279. );
  280. //根据返回的结果,封装原始数据为Bean/Entity对象
  281. if (result.isSuccess) {
  282. //重新赋值data或list
  283. final list = result.getListJson();
  284. List<ServiceTimePeriodEntity> listEntity= list!.map((e)=>ServiceTimePeriodEntity.fromJson(e)).toList();
  285. //重新赋值data或list
  286. return result.convert(list: listEntity);
  287. }else {
  288. if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
  289. ToastEngine.show("${result.errorMsg}");
  290. }
  291. }
  292. return result.convert();
  293. }
  294. // 付费服务 下单
  295. Future<HttpResult<Object>> fetchPaidServiceBook(
  296. Map<String, dynamic>? data, {
  297. CancelToken? cancelToken,
  298. }) async {
  299. Map<String, dynamic> params = {};
  300. params = data!;
  301. Map<String, String> headers = {};
  302. headers["Content-Type"] = "application/x-www-form-urlencoded";
  303. headers["Accept"] = "application/x.yyjobs-api.v1+json";
  304. final result = await dioEngine.requestNetResult(
  305. // ApiConstants.apiServerTime, // api 地址
  306. '/api/v1/user/service/paid-service-order/book', // api 地址
  307. params: params,
  308. headers: headers,
  309. method: HttpMethod.POST,
  310. isShowLoadingDialog: true,
  311. //是否展示默认的Loading弹窗
  312. networkDebounce: true,
  313. //是否防抖防止重复请求
  314. cancelToken: cancelToken,
  315. );
  316. //根据返回的结果,封装原始数据为Bean/Entity对象
  317. if (result.isSuccess) {
  318. //重新赋值data或list
  319. final json = result.getDataJson();
  320. var data = PaidServicePaySuccessInfoEntity.fromJson(json!);
  321. //重新赋值data或list
  322. return result.convert(data: json);
  323. } else {
  324. if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
  325. ToastEngine.show("${result.errorMsg}");
  326. }
  327. }
  328. return result.convert();
  329. }
  330. // 付费服务 订单列表
  331. Future<HttpResult<GarageSaleHistoryEntity>> fetchPaidServiceOrderList({
  332. required String type,
  333. required int curPage,
  334. CancelToken? cancelToken,
  335. }) async {
  336. Map<String, String> params = {};
  337. params['type'] = type;
  338. params['page'] = curPage.toString();
  339. params['limit'] = "10";
  340. final result = await dioEngine.requestNetResult(
  341. '/api/v1/user/service/paid-service-order/index',
  342. params: params,
  343. method: HttpMethod.GET,
  344. isShowLoadingDialog: false,
  345. //是否展示默认的Loading弹窗
  346. networkDebounce: true,
  347. //是否防抖防止重复请求
  348. cancelToken: cancelToken,
  349. );
  350. if (result.isSuccess) {
  351. final json = result.getDataJson();
  352. var data = GarageSaleHistoryEntity.fromJson(json!);
  353. return result.convert<GarageSaleHistoryEntity>(data: data);
  354. }
  355. return result.convert();
  356. }
  357. // 获取 付费服务 订单详情
  358. Future<HttpResult<ServiceOrderDetailEntity>> fetchPaidServiceCleanOrderDetail({
  359. required String id,
  360. CancelToken? cancelToken,
  361. }) async {
  362. Map<String, dynamic> params = {};
  363. params['id'] = id;
  364. final result = await dioEngine.requestNetResult(
  365. '/api/v1/user/service/paid-service-order/detail',
  366. params: params,
  367. method: HttpMethod.GET,
  368. isShowLoadingDialog: false,
  369. //是否展示默认的Loading弹窗
  370. networkDebounce: true,
  371. //是否防抖防止重复请求
  372. cancelToken: cancelToken,
  373. );
  374. if (result.isSuccess) {
  375. final json = result.getDataJson();
  376. var data = ServiceOrderDetailEntity.fromJson(json!);
  377. return result.convert<ServiceOrderDetailEntity>(data: data);
  378. }
  379. return result.convert();
  380. }
  381. // 获取 付费订单实际需要支付的价格
  382. Future<HttpResult<Object>> fetchPaidServiceCleanOrderPrice(
  383. Map<String, dynamic>? data, {
  384. CancelToken? cancelToken,
  385. }) async {
  386. Map<String, dynamic> params = {};
  387. params = data!;
  388. Map<String, String> headers = {};
  389. // headers["Content-Type"] = "application/x-www-form-urlencoded";
  390. // headers["Accept"] = "application/x.yyjobs-api.v1+json";
  391. final result = await dioEngine.requestNetResult(
  392. // ApiConstants.apiServerTime, // api 地址
  393. '/api/v1/user/service/paid-service-order/price', // api 地址
  394. params: params,
  395. headers: headers,
  396. method: HttpMethod.GET,
  397. isShowLoadingDialog: false,
  398. //是否展示默认的Loading弹窗
  399. networkDebounce: true,
  400. //是否防抖防止重复请求
  401. cancelToken: cancelToken,
  402. );
  403. //根据返回的结果,封装原始数据为Bean/Entity对象
  404. if (result.isSuccess) {
  405. //重新赋值data或list
  406. final json = result.getDataJson();
  407. // var data = GarageSaleRentDetailEntity.fromJson(json!);
  408. //重新赋值data或list
  409. return result.convert(data: json);
  410. } else {
  411. if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
  412. ToastEngine.show("${result.errorMsg}");
  413. }
  414. }
  415. return result.convert();
  416. }
  417. // 付费服务 取消订单
  418. Future<HttpResult> fetchCancelPaidServiceOrder({
  419. required String? id,
  420. required String? reason,
  421. CancelToken? cancelToken,
  422. }) async {
  423. Map<String, String> params = {};
  424. params['id'] = id ?? "";
  425. params['cancel_reason'] = reason ?? "";
  426. final result = await dioEngine.requestNetResult(
  427. '/api/v1/user/service/paid-service-order/cancel',
  428. params: params,
  429. method: HttpMethod.POST,
  430. isShowLoadingDialog: true,
  431. networkDebounce: true,
  432. cancelToken: cancelToken,
  433. );
  434. if (result.isSuccess) {
  435. return result.convert();
  436. }
  437. return result.convert();
  438. }
  439. ///-------------------咨询类---------------------------------
  440. // 维修服务 列表
  441. Future<HttpResult<Object>> fetchRepairServiceList(
  442. Map<String, dynamic>? data, {
  443. CancelToken? cancelToken,
  444. }) async {
  445. Map<String, dynamic> params = {};
  446. params = data!;
  447. Map<String, String> headers = {};
  448. headers["Content-Type"] = "application/x-www-form-urlencoded";
  449. headers["Accept"] = "application/x.yyjobs-api.v1+json";
  450. final result = await dioEngine.requestNetResult(
  451. // ApiConstants.apiServerTime, // api 地址
  452. '/api/v1/user/service/inquiry-service/index', // api 地址
  453. params: params,
  454. headers: headers,
  455. method: HttpMethod.GET,
  456. isShowLoadingDialog: false,
  457. //是否展示默认的Loading弹窗
  458. networkDebounce: true,
  459. //是否防抖防止重复请求
  460. cancelToken: cancelToken,
  461. );
  462. //根据返回的结果,封装原始数据为Bean/Entity对象
  463. if (result.isSuccess) {
  464. //重新赋值data或list
  465. final json = result.getDataJson();
  466. var data = RepairServiceEntity.fromJson(json!);
  467. //重新赋值data或list
  468. return result.convert(data: data);
  469. } else {
  470. if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
  471. ToastEngine.show("${result.errorMsg}");
  472. }
  473. }
  474. return result.convert();
  475. }
  476. // 获取 repair 详情信息
  477. Future<HttpResult<Object>> fetchServiceRepairDetailInfo(
  478. Map<String, dynamic>? data, {
  479. CancelToken? cancelToken,
  480. }) async {
  481. Map<String, dynamic> params = {};
  482. params = data!;
  483. Map<String, String> headers = {};
  484. // headers["Content-Type"] = "application/x-www-form-urlencoded";
  485. // headers["Accept"] = "application/x.yyjobs-api.v1+json";
  486. final result = await dioEngine.requestNetResult(
  487. // ApiConstants.apiServerTime, // api 地址
  488. '/api/v1/user/service/inquiry-service/detail', // api 地址
  489. params: params,
  490. headers: headers,
  491. method: HttpMethod.GET,
  492. isShowLoadingDialog: false,
  493. //是否展示默认的Loading弹窗
  494. networkDebounce: true,
  495. //是否防抖防止重复请求
  496. cancelToken: cancelToken,
  497. );
  498. //根据返回的结果,封装原始数据为Bean/Entity对象
  499. if (result.isSuccess) {
  500. //重新赋值data或list
  501. final json = result.getDataJson();
  502. var data = ServiceRepairDetailEntity.fromJson(json!);
  503. //重新赋值data或list
  504. return result.convert(data: data);
  505. } else {
  506. if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
  507. ToastEngine.show("${result.errorMsg}");
  508. }
  509. }
  510. return result.convert();
  511. }
  512. // 维修服务 提交咨询
  513. Future<HttpResult<Object>> fetchRepairServiceSubmit(
  514. Map<String, dynamic>? data, {
  515. CancelToken? cancelToken,
  516. }) async {
  517. Map<String, dynamic> params = {};
  518. params = data!;
  519. Map<String, String> headers = {};
  520. headers["Content-Type"] = "application/x-www-form-urlencoded";
  521. headers["Accept"] = "application/x.yyjobs-api.v1+json";
  522. final result = await dioEngine.requestNetResult(
  523. // ApiConstants.apiServerTime, // api 地址
  524. '/api/v1/user/service/inquiry-service-order/submit', // api 地址
  525. params: params,
  526. headers: headers,
  527. method: HttpMethod.POST,
  528. isShowLoadingDialog: true,
  529. //是否展示默认的Loading弹窗
  530. networkDebounce: true,
  531. //是否防抖防止重复请求
  532. cancelToken: cancelToken,
  533. );
  534. //根据返回的结果,封装原始数据为Bean/Entity对象
  535. if (result.isSuccess) {
  536. //重新赋值data或list
  537. final json = result.getDataJson();
  538. // var data = NewsfeedForyouEntity.fromJson(json!);
  539. //重新赋值data或list
  540. return result.convert(data: json);
  541. } else {
  542. if (result.errorMsg != null && result.errorMsg!.isNotEmpty) {
  543. ToastEngine.show("${result.errorMsg}");
  544. }
  545. }
  546. return result.convert();
  547. }
  548. // 维修服务 订单列表
  549. Future<HttpResult<GarageSaleHistoryEntity>> fetchRepairServiceOrderList({
  550. required int status,
  551. required int curPage,
  552. CancelToken? cancelToken,
  553. }) async {
  554. Map<String, String> params = {};
  555. params['status'] = status.toString();
  556. params['page'] = curPage.toString();
  557. params['limit'] = "10";
  558. final result = await dioEngine.requestNetResult(
  559. '/api/v1/user/service/inquiry-service-order/index',
  560. params: params,
  561. method: HttpMethod.GET,
  562. isShowLoadingDialog: false,
  563. //是否展示默认的Loading弹窗
  564. networkDebounce: true,
  565. //是否防抖防止重复请求
  566. cancelToken: cancelToken,
  567. );
  568. if (result.isSuccess) {
  569. final json = result.getDataJson();
  570. var data = GarageSaleHistoryEntity.fromJson(json!);
  571. return result.convert<GarageSaleHistoryEntity>(data: data);
  572. }
  573. return result.convert();
  574. }
  575. }