services_respository.dart 21 KB

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