services_respository.dart 21 KB

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