api.g.dart 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887
  1. // GENERATED CODE - DO NOT MODIFY BY HAND
  2. part of 'api.dart';
  3. // **************************************************************************
  4. // RetrofitGenerator
  5. // **************************************************************************
  6. // ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers
  7. class _Api implements Api {
  8. _Api(
  9. this._dio, {
  10. this.baseUrl,
  11. });
  12. final Dio _dio;
  13. String? baseUrl;
  14. @override
  15. Future<ApiRsp<LoginRsp>> login(LoginReq req) async {
  16. const _extra = <String, dynamic>{};
  17. final queryParameters = <String, dynamic>{};
  18. final _headers = <String, dynamic>{};
  19. final _data = <String, dynamic>{};
  20. _data.addAll(req.toJson());
  21. final _result = await _dio
  22. .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<LoginRsp>>(Options(
  23. method: 'POST',
  24. headers: _headers,
  25. extra: _extra,
  26. )
  27. .compose(
  28. _dio.options,
  29. '/admin-api/system/auth/login',
  30. queryParameters: queryParameters,
  31. data: _data,
  32. )
  33. .copyWith(
  34. baseUrl: _combineBaseUrls(
  35. _dio.options.baseUrl,
  36. baseUrl,
  37. ))));
  38. final value = ApiRsp<LoginRsp>.fromJson(
  39. _result.data!,
  40. (json) => LoginRsp.fromJson(json as Map<String, dynamic>),
  41. );
  42. return value;
  43. }
  44. @override
  45. Future<ApiRsp<UserRsp>> userProfile() async {
  46. const _extra = <String, dynamic>{};
  47. final queryParameters = <String, dynamic>{};
  48. final _headers = <String, dynamic>{};
  49. final Map<String, dynamic>? _data = null;
  50. final _result = await _dio
  51. .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<UserRsp>>(Options(
  52. method: 'GET',
  53. headers: _headers,
  54. extra: _extra,
  55. )
  56. .compose(
  57. _dio.options,
  58. '/admin-api/system/user/profile/get',
  59. queryParameters: queryParameters,
  60. data: _data,
  61. )
  62. .copyWith(
  63. baseUrl: _combineBaseUrls(
  64. _dio.options.baseUrl,
  65. baseUrl,
  66. ))));
  67. final value = ApiRsp<UserRsp>.fromJson(
  68. _result.data!,
  69. (json) => UserRsp.fromJson(json as Map<String, dynamic>),
  70. );
  71. return value;
  72. }
  73. @override
  74. Future<ApiRsp<bool>> updatePassword(Map<String, dynamic> map) async {
  75. const _extra = <String, dynamic>{};
  76. final queryParameters = <String, dynamic>{};
  77. final _headers = <String, dynamic>{};
  78. final _data = <String, dynamic>{};
  79. _data.addAll(map);
  80. final _result = await _dio
  81. .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<bool>>(Options(
  82. method: 'PUT',
  83. headers: _headers,
  84. extra: _extra,
  85. )
  86. .compose(
  87. _dio.options,
  88. '/admin-api/system/user/profile/update-password',
  89. queryParameters: queryParameters,
  90. data: _data,
  91. )
  92. .copyWith(
  93. baseUrl: _combineBaseUrls(
  94. _dio.options.baseUrl,
  95. baseUrl,
  96. ))));
  97. final value = ApiRsp<bool>.fromJson(
  98. _result.data!,
  99. (json) => json as bool,
  100. );
  101. return value;
  102. }
  103. @override
  104. Future<ApiRsp<List<storehouseRsp>>> getStoreMessage(
  105. String ajbm,
  106. String key,
  107. ) async {
  108. const _extra = <String, dynamic>{};
  109. final queryParameters = <String, dynamic>{
  110. r'ajbm': ajbm,
  111. r'key': key,
  112. };
  113. final _headers = <String, dynamic>{};
  114. final Map<String, dynamic>? _data = null;
  115. final _result = await _dio.fetch<Map<String, dynamic>>(
  116. _setStreamType<ApiRsp<List<storehouseRsp>>>(Options(
  117. method: 'GET',
  118. headers: _headers,
  119. extra: _extra,
  120. )
  121. .compose(
  122. _dio.options,
  123. '/admin-api/coding/fmxx/queryLsxxList',
  124. queryParameters: queryParameters,
  125. data: _data,
  126. )
  127. .copyWith(
  128. baseUrl: _combineBaseUrls(
  129. _dio.options.baseUrl,
  130. baseUrl,
  131. ))));
  132. final value = ApiRsp<List<storehouseRsp>>.fromJson(
  133. _result.data!,
  134. (json) => json is List<dynamic>
  135. ? json
  136. .map<storehouseRsp>(
  137. (i) => storehouseRsp.fromJson(i as Map<String, dynamic>))
  138. .toList()
  139. : List.empty(),
  140. );
  141. return value;
  142. }
  143. @override
  144. Future<ApiRsp<List<DictRsp>>> getAllDict() async {
  145. const _extra = <String, dynamic>{};
  146. final queryParameters = <String, dynamic>{};
  147. final _headers = <String, dynamic>{};
  148. final Map<String, dynamic>? _data = null;
  149. final _result = await _dio.fetch<Map<String, dynamic>>(
  150. _setStreamType<ApiRsp<List<DictRsp>>>(Options(
  151. method: 'GET',
  152. headers: _headers,
  153. extra: _extra,
  154. )
  155. .compose(
  156. _dio.options,
  157. '/admin-api/system/dict-data/simple-list',
  158. queryParameters: queryParameters,
  159. data: _data,
  160. )
  161. .copyWith(
  162. baseUrl: _combineBaseUrls(
  163. _dio.options.baseUrl,
  164. baseUrl,
  165. ))));
  166. final value = ApiRsp<List<DictRsp>>.fromJson(
  167. _result.data!,
  168. (json) => json is List<dynamic>
  169. ? json
  170. .map<DictRsp>((i) => DictRsp.fromJson(i as Map<String, dynamic>))
  171. .toList()
  172. : List.empty(),
  173. );
  174. return value;
  175. }
  176. @override
  177. Future<ApiRsp<SampleTaskListRsp>> sampleTaskList(
  178. Map<String, dynamic> map) async {
  179. const _extra = <String, dynamic>{};
  180. final queryParameters = <String, dynamic>{};
  181. queryParameters.addAll(map);
  182. final _headers = <String, dynamic>{};
  183. final Map<String, dynamic>? _data = null;
  184. final _result = await _dio.fetch<Map<String, dynamic>>(
  185. _setStreamType<ApiRsp<SampleTaskListRsp>>(Options(
  186. method: 'GET',
  187. headers: _headers,
  188. extra: _extra,
  189. )
  190. .compose(
  191. _dio.options,
  192. '/admin-api/zj/code-sampling-task-details-sgjc/sampling_task_detail_page',
  193. queryParameters: queryParameters,
  194. data: _data,
  195. )
  196. .copyWith(
  197. baseUrl: _combineBaseUrls(
  198. _dio.options.baseUrl,
  199. baseUrl,
  200. ))));
  201. final value = ApiRsp<SampleTaskListRsp>.fromJson(
  202. _result.data!,
  203. (json) => SampleTaskListRsp.fromJson(json as Map<String, dynamic>),
  204. );
  205. return value;
  206. }
  207. @override
  208. Future<ApiRsp<String?>> getAppDownloadUrl() async {
  209. const _extra = <String, dynamic>{};
  210. final queryParameters = <String, dynamic>{};
  211. final _headers = <String, dynamic>{};
  212. final Map<String, dynamic>? _data = null;
  213. final _result = await _dio
  214. .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<String>>(Options(
  215. method: 'GET',
  216. headers: _headers,
  217. extra: _extra,
  218. )
  219. .compose(
  220. _dio.options,
  221. '/admin-api/zj/base-file/getAppDownLoadUrl',
  222. queryParameters: queryParameters,
  223. data: _data,
  224. )
  225. .copyWith(
  226. baseUrl: _combineBaseUrls(
  227. _dio.options.baseUrl,
  228. baseUrl,
  229. ))));
  230. final value = ApiRsp<String?>.fromJson(
  231. _result.data!,
  232. (json) => json as String?,
  233. );
  234. return value;
  235. }
  236. @override
  237. Future<ApiRsp<UrlItem?>> getAppDownLoadUrlAndName() async {
  238. const _extra = <String, dynamic>{};
  239. final queryParameters = <String, dynamic>{};
  240. final _headers = <String, dynamic>{};
  241. final Map<String, dynamic>? _data = null;
  242. final _result = await _dio
  243. .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<UrlItem>>(Options(
  244. method: 'GET',
  245. headers: _headers,
  246. extra: _extra,
  247. )
  248. .compose(
  249. _dio.options,
  250. '/admin-api/zj/base-file/getAppDownLoadUrlAndName',
  251. queryParameters: queryParameters,
  252. data: _data,
  253. )
  254. .copyWith(
  255. baseUrl: _combineBaseUrls(
  256. _dio.options.baseUrl,
  257. baseUrl,
  258. ))));
  259. final value = ApiRsp<UrlItem?>.fromJson(
  260. _result.data!,
  261. (json) =>
  262. json == null ? null : UrlItem.fromJson(json as Map<String, dynamic>),
  263. );
  264. return value;
  265. }
  266. @override
  267. Future<ApiRsp<DeviationLoactionRsp?>> updateSampleTaskSgjc(
  268. Map<String, dynamic> map) async {
  269. const _extra = <String, dynamic>{};
  270. final queryParameters = <String, dynamic>{};
  271. final _headers = <String, dynamic>{};
  272. final _data = <String, dynamic>{};
  273. _data.addAll(map);
  274. final _result = await _dio.fetch<Map<String, dynamic>>(
  275. _setStreamType<ApiRsp<DeviationLoactionRsp>>(Options(
  276. method: 'PUT',
  277. headers: _headers,
  278. extra: _extra,
  279. )
  280. .compose(
  281. _dio.options,
  282. '/admin-api/zj/code-sampling-task-details-sgjc/update',
  283. queryParameters: queryParameters,
  284. data: _data,
  285. )
  286. .copyWith(
  287. baseUrl: _combineBaseUrls(
  288. _dio.options.baseUrl,
  289. baseUrl,
  290. ))));
  291. final value = ApiRsp<DeviationLoactionRsp?>.fromJson(
  292. _result.data!,
  293. (json) => json == null
  294. ? null
  295. : DeviationLoactionRsp.fromJson(json as Map<String, dynamic>),
  296. );
  297. return value;
  298. }
  299. @override
  300. Future<ApiRsp<bool?>> updateSampleTaskKcjc(Map<String, dynamic> map) async {
  301. const _extra = <String, dynamic>{};
  302. final queryParameters = <String, dynamic>{};
  303. final _headers = <String, dynamic>{};
  304. final _data = <String, dynamic>{};
  305. _data.addAll(map);
  306. final _result = await _dio
  307. .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<bool>>(Options(
  308. method: 'PUT',
  309. headers: _headers,
  310. extra: _extra,
  311. )
  312. .compose(
  313. _dio.options,
  314. '/admin-api/zj/code-sampling-task-details-kcjc/update',
  315. queryParameters: queryParameters,
  316. data: _data,
  317. )
  318. .copyWith(
  319. baseUrl: _combineBaseUrls(
  320. _dio.options.baseUrl,
  321. baseUrl,
  322. ))));
  323. final value = ApiRsp<bool?>.fromJson(
  324. _result.data!,
  325. (json) => json as bool?,
  326. );
  327. return value;
  328. }
  329. @override
  330. Future<ApiRsp<SampleTaskItem?>> sampleTaskDetailSgjc(num id) async {
  331. const _extra = <String, dynamic>{};
  332. final queryParameters = <String, dynamic>{r'id': id};
  333. final _headers = <String, dynamic>{};
  334. final Map<String, dynamic>? _data = null;
  335. final _result = await _dio.fetch<Map<String, dynamic>>(
  336. _setStreamType<ApiRsp<SampleTaskItem>>(Options(
  337. method: 'GET',
  338. headers: _headers,
  339. extra: _extra,
  340. )
  341. .compose(
  342. _dio.options,
  343. '/admin-api/zj/code-sampling-task-details-sgjc/getSamplingTaskDetails',
  344. queryParameters: queryParameters,
  345. data: _data,
  346. )
  347. .copyWith(
  348. baseUrl: _combineBaseUrls(
  349. _dio.options.baseUrl,
  350. baseUrl,
  351. ))));
  352. final value = ApiRsp<SampleTaskItem?>.fromJson(
  353. _result.data!,
  354. (json) => json == null
  355. ? null
  356. : SampleTaskItem.fromJson(json as Map<String, dynamic>),
  357. );
  358. return value;
  359. }
  360. @override
  361. Future<ApiRsp<SampleTaskItemKcjcRsp?>> sampleTaskDetailKcjc(num id) async {
  362. const _extra = <String, dynamic>{};
  363. final queryParameters = <String, dynamic>{r'id': id};
  364. final _headers = <String, dynamic>{};
  365. final Map<String, dynamic>? _data = null;
  366. final _result = await _dio.fetch<Map<String, dynamic>>(
  367. _setStreamType<ApiRsp<SampleTaskItemKcjcRsp>>(Options(
  368. method: 'GET',
  369. headers: _headers,
  370. extra: _extra,
  371. )
  372. .compose(
  373. _dio.options,
  374. '/admin-api/zj/code-sampling-task-details-kcjc/get',
  375. queryParameters: queryParameters,
  376. data: _data,
  377. )
  378. .copyWith(
  379. baseUrl: _combineBaseUrls(
  380. _dio.options.baseUrl,
  381. baseUrl,
  382. ))));
  383. final value = ApiRsp<SampleTaskItemKcjcRsp?>.fromJson(
  384. _result.data!,
  385. (json) => json == null
  386. ? null
  387. : SampleTaskItemKcjcRsp.fromJson(json as Map<String, dynamic>),
  388. );
  389. return value;
  390. }
  391. @override
  392. Future<ApiRsp<List<TrxxRsp>?>> trxxList() async {
  393. const _extra = <String, dynamic>{};
  394. final queryParameters = <String, dynamic>{};
  395. final _headers = <String, dynamic>{};
  396. final Map<String, dynamic>? _data = null;
  397. final _result = await _dio.fetch<Map<String, dynamic>>(
  398. _setStreamType<ApiRsp<List<TrxxRsp>>>(Options(
  399. method: 'GET',
  400. headers: _headers,
  401. extra: _extra,
  402. )
  403. .compose(
  404. _dio.options,
  405. '/admin-api/zj/base-soil-information/trxxxz',
  406. queryParameters: queryParameters,
  407. data: _data,
  408. )
  409. .copyWith(
  410. baseUrl: _combineBaseUrls(
  411. _dio.options.baseUrl,
  412. baseUrl,
  413. ))));
  414. final value = ApiRsp<List<TrxxRsp>>.fromJson(
  415. _result.data!,
  416. (json) => json is List<dynamic>
  417. ? json
  418. .map<TrxxRsp>((i) => TrxxRsp.fromJson(i as Map<String, dynamic>))
  419. .toList()
  420. : List.empty(),
  421. );
  422. return value;
  423. }
  424. @override
  425. Future<ApiRsp<List<LsxxRsp>?>> lsxxList(String zlmc) async {
  426. const _extra = <String, dynamic>{};
  427. final queryParameters = <String, dynamic>{r'zlmc': zlmc};
  428. final _headers = <String, dynamic>{};
  429. final Map<String, dynamic>? _data = null;
  430. final _result = await _dio.fetch<Map<String, dynamic>>(
  431. _setStreamType<ApiRsp<List<LsxxRsp>>>(Options(
  432. method: 'GET',
  433. headers: _headers,
  434. extra: _extra,
  435. )
  436. .compose(
  437. _dio.options,
  438. '/admin-api/zj/base-grain-information/lsxxfl',
  439. queryParameters: queryParameters,
  440. data: _data,
  441. )
  442. .copyWith(
  443. baseUrl: _combineBaseUrls(
  444. _dio.options.baseUrl,
  445. baseUrl,
  446. ))));
  447. final value = ApiRsp<List<LsxxRsp>>.fromJson(
  448. _result.data!,
  449. (json) => json is List<dynamic>
  450. ? json
  451. .map<LsxxRsp>((i) => LsxxRsp.fromJson(i as Map<String, dynamic>))
  452. .toList()
  453. : List.empty(),
  454. );
  455. return value;
  456. }
  457. @override
  458. Future<ApiRsp<num?>> receiveSampleTaskSgjc(num id) async {
  459. const _extra = <String, dynamic>{};
  460. final queryParameters = <String, dynamic>{r'id': id};
  461. final _headers = <String, dynamic>{};
  462. final Map<String, dynamic>? _data = null;
  463. final _result = await _dio
  464. .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<num>>(Options(
  465. method: 'GET',
  466. headers: _headers,
  467. extra: _extra,
  468. )
  469. .compose(
  470. _dio.options,
  471. '/admin-api/zj/code-sampling-task-details-sgjc/updateStatus',
  472. queryParameters: queryParameters,
  473. data: _data,
  474. )
  475. .copyWith(
  476. baseUrl: _combineBaseUrls(
  477. _dio.options.baseUrl,
  478. baseUrl,
  479. ))));
  480. final value = ApiRsp<num?>.fromJson(
  481. _result.data!,
  482. (json) => json as num?,
  483. );
  484. return value;
  485. }
  486. @override
  487. Future<ApiRsp<List<PersonRsp>?>> getPersonMenu(num jhcyjg) async {
  488. const _extra = <String, dynamic>{};
  489. final queryParameters = <String, dynamic>{r'jhcyjg': jhcyjg};
  490. final _headers = <String, dynamic>{};
  491. final Map<String, dynamic>? _data = null;
  492. final _result = await _dio.fetch<Map<String, dynamic>>(
  493. _setStreamType<ApiRsp<List<PersonRsp>>>(Options(
  494. method: 'GET',
  495. headers: _headers,
  496. extra: _extra,
  497. )
  498. .compose(
  499. _dio.options,
  500. '/admin-api/zj/base-personnel/selectByJhcyjg',
  501. queryParameters: queryParameters,
  502. data: _data,
  503. )
  504. .copyWith(
  505. baseUrl: _combineBaseUrls(
  506. _dio.options.baseUrl,
  507. baseUrl,
  508. ))));
  509. final value = ApiRsp<List<PersonRsp>>.fromJson(
  510. _result.data!,
  511. (json) => json is List<dynamic>
  512. ? json
  513. .map<PersonRsp>(
  514. (i) => PersonRsp.fromJson(i as Map<String, dynamic>))
  515. .toList()
  516. : List.empty(),
  517. );
  518. return value;
  519. }
  520. @override
  521. Future<ApiRsp<List<DistrictRsp>?>> districtList(
  522. num uLevel, {
  523. num? id,
  524. }) async {
  525. const _extra = <String, dynamic>{};
  526. final queryParameters = <String, dynamic>{
  527. r'uLevel': uLevel,
  528. r'id': id,
  529. };
  530. queryParameters.removeWhere((k, v) => v == null);
  531. final _headers = <String, dynamic>{};
  532. final Map<String, dynamic>? _data = null;
  533. final _result = await _dio.fetch<Map<String, dynamic>>(
  534. _setStreamType<ApiRsp<List<DistrictRsp>>>(Options(
  535. method: 'GET',
  536. headers: _headers,
  537. extra: _extra,
  538. )
  539. .compose(
  540. _dio.options,
  541. '/admin-api/zj/base-administrative-division/list',
  542. queryParameters: queryParameters,
  543. data: _data,
  544. )
  545. .copyWith(
  546. baseUrl: _combineBaseUrls(
  547. _dio.options.baseUrl,
  548. baseUrl,
  549. ))));
  550. final value = ApiRsp<List<DistrictRsp>>.fromJson(
  551. _result.data!,
  552. (json) => json is List<dynamic>
  553. ? json
  554. .map<DistrictRsp>(
  555. (i) => DistrictRsp.fromJson(i as Map<String, dynamic>))
  556. .toList()
  557. : List.empty(),
  558. );
  559. return value;
  560. }
  561. @override
  562. Future<ApiRsp<String?>> upload(File file) async {
  563. const _extra = <String, dynamic>{};
  564. final queryParameters = <String, dynamic>{};
  565. final _headers = <String, dynamic>{};
  566. final _data = FormData();
  567. _data.files.add(MapEntry(
  568. 'file',
  569. MultipartFile.fromFileSync(
  570. file.path,
  571. filename: file.path.split(Platform.pathSeparator).last,
  572. ),
  573. ));
  574. final _result = await _dio
  575. .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<String>>(Options(
  576. method: 'POST',
  577. headers: _headers,
  578. extra: _extra,
  579. )
  580. .compose(
  581. _dio.options,
  582. '/admin-api/infra/file/upload',
  583. queryParameters: queryParameters,
  584. data: _data,
  585. )
  586. .copyWith(
  587. baseUrl: _combineBaseUrls(
  588. _dio.options.baseUrl,
  589. baseUrl,
  590. ))));
  591. final value = ApiRsp<String?>.fromJson(
  592. _result.data!,
  593. (json) => json as String?,
  594. );
  595. return value;
  596. }
  597. @override
  598. Future<ApiRsp<dynamic>> postDeviceInfos(List<DeviceReq> req) async {
  599. const _extra = <String, dynamic>{};
  600. final queryParameters = <String, dynamic>{};
  601. final _headers = <String, dynamic>{};
  602. final _data = req.map((e) => e.toJson()).toList();
  603. final _result = await _dio
  604. .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<dynamic>>(Options(
  605. method: 'POST',
  606. headers: _headers,
  607. extra: _extra,
  608. )
  609. .compose(
  610. _dio.options,
  611. '/admin-api/zj/base-device/createBatch',
  612. queryParameters: queryParameters,
  613. data: _data,
  614. )
  615. .copyWith(
  616. baseUrl: _combineBaseUrls(
  617. _dio.options.baseUrl,
  618. baseUrl,
  619. ))));
  620. final value = ApiRsp<dynamic>.fromJson(
  621. _result.data!,
  622. (json) => json as dynamic,
  623. );
  624. return value;
  625. }
  626. @override
  627. Future<ApiRsp<bool?>> postPhoneMsg(Map<String, dynamic> map) async {
  628. const _extra = <String, dynamic>{};
  629. final queryParameters = <String, dynamic>{};
  630. final _headers = <String, dynamic>{};
  631. final _data = <String, dynamic>{};
  632. _data.addAll(map);
  633. final _result = await _dio
  634. .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<bool>>(Options(
  635. method: 'POST',
  636. headers: _headers,
  637. extra: _extra,
  638. )
  639. .compose(
  640. _dio.options,
  641. '/admin-api/system/auth/reset_password_send_sms_code',
  642. queryParameters: queryParameters,
  643. data: _data,
  644. )
  645. .copyWith(
  646. baseUrl: _combineBaseUrls(
  647. _dio.options.baseUrl,
  648. baseUrl,
  649. ))));
  650. final value = ApiRsp<bool?>.fromJson(
  651. _result.data!,
  652. (json) => json as bool?,
  653. );
  654. return value;
  655. }
  656. @override
  657. Future<ApiRsp<bool?>> loginWithPhoneMsg(Map<String, dynamic> map) async {
  658. const _extra = <String, dynamic>{};
  659. final queryParameters = <String, dynamic>{};
  660. final _headers = <String, dynamic>{};
  661. final _data = <String, dynamic>{};
  662. _data.addAll(map);
  663. final _result = await _dio
  664. .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<bool>>(Options(
  665. method: 'POST',
  666. headers: _headers,
  667. extra: _extra,
  668. )
  669. .compose(
  670. _dio.options,
  671. '/admin-api/system/auth/send-sms-code',
  672. queryParameters: queryParameters,
  673. data: _data,
  674. )
  675. .copyWith(
  676. baseUrl: _combineBaseUrls(
  677. _dio.options.baseUrl,
  678. baseUrl,
  679. ))));
  680. final value = ApiRsp<bool?>.fromJson(
  681. _result.data!,
  682. (json) => json as bool?,
  683. );
  684. return value;
  685. }
  686. @override
  687. Future<ApiRsp<LoginRsp>> smsLogin(Map<String, dynamic> map) async {
  688. const _extra = <String, dynamic>{};
  689. final queryParameters = <String, dynamic>{};
  690. final _headers = <String, dynamic>{};
  691. final _data = <String, dynamic>{};
  692. _data.addAll(map);
  693. final _result = await _dio
  694. .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<LoginRsp>>(Options(
  695. method: 'POST',
  696. headers: _headers,
  697. extra: _extra,
  698. )
  699. .compose(
  700. _dio.options,
  701. '/admin-api/system/auth/sms-login',
  702. queryParameters: queryParameters,
  703. data: _data,
  704. )
  705. .copyWith(
  706. baseUrl: _combineBaseUrls(
  707. _dio.options.baseUrl,
  708. baseUrl,
  709. ))));
  710. final value = ApiRsp<LoginRsp>.fromJson(
  711. _result.data!,
  712. (json) => LoginRsp.fromJson(json as Map<String, dynamic>),
  713. );
  714. return value;
  715. }
  716. @override
  717. Future<ApiRsp<bool?>> resetPassword(Map<String, dynamic> map) async {
  718. const _extra = <String, dynamic>{};
  719. final queryParameters = <String, dynamic>{};
  720. final _headers = <String, dynamic>{};
  721. final _data = <String, dynamic>{};
  722. _data.addAll(map);
  723. final _result = await _dio
  724. .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<bool>>(Options(
  725. method: 'POST',
  726. headers: _headers,
  727. extra: _extra,
  728. )
  729. .compose(
  730. _dio.options,
  731. '/admin-api/system/auth/reset_password',
  732. queryParameters: queryParameters,
  733. data: _data,
  734. )
  735. .copyWith(
  736. baseUrl: _combineBaseUrls(
  737. _dio.options.baseUrl,
  738. baseUrl,
  739. ))));
  740. final value = ApiRsp<bool?>.fromJson(
  741. _result.data!,
  742. (json) => json as bool?,
  743. );
  744. return value;
  745. }
  746. @override
  747. Future<ApiRsp<List<StockPointsRsp>?>> stockPoints({
  748. double? width,
  749. double? length,
  750. double? height,
  751. double? partitionSize,
  752. bool? randomOffset,
  753. double? offsetRange,
  754. }) async {
  755. const _extra = <String, dynamic>{};
  756. final queryParameters = <String, dynamic>{
  757. r'width': width,
  758. r'length': length,
  759. r'height': height,
  760. r'partitionSize': partitionSize,
  761. r'randomOffset': randomOffset,
  762. r'offsetRange': offsetRange,
  763. };
  764. queryParameters.removeWhere((k, v) => v == null);
  765. final _headers = <String, dynamic>{};
  766. final Map<String, dynamic>? _data = null;
  767. final _result = await _dio.fetch<Map<String, dynamic>>(
  768. _setStreamType<ApiRsp<List<StockPointsRsp>>>(Options(
  769. method: 'GET',
  770. headers: _headers,
  771. extra: _extra,
  772. )
  773. .compose(
  774. _dio.options,
  775. '/admin-api/zj/kcqydsyt-fsc/flat-sampling-points',
  776. queryParameters: queryParameters,
  777. data: _data,
  778. )
  779. .copyWith(
  780. baseUrl: _combineBaseUrls(
  781. _dio.options.baseUrl,
  782. baseUrl,
  783. ))));
  784. final value = ApiRsp<List<StockPointsRsp>>.fromJson(
  785. _result.data!,
  786. (json) => json is List<dynamic>
  787. ? json
  788. .map<StockPointsRsp>(
  789. (i) => StockPointsRsp.fromJson(i as Map<String, dynamic>))
  790. .toList()
  791. : List.empty(),
  792. );
  793. return value;
  794. }
  795. @override
  796. Future<ApiRsp<bool?>> changeSampleTaskKcjc(Map<String, dynamic> map) async {
  797. const _extra = <String, dynamic>{};
  798. final queryParameters = <String, dynamic>{};
  799. final _headers = <String, dynamic>{};
  800. final _data = <String, dynamic>{};
  801. _data.addAll(map);
  802. final _result = await _dio
  803. .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<bool>>(Options(
  804. method: 'PUT',
  805. headers: _headers,
  806. extra: _extra,
  807. )
  808. .compose(
  809. _dio.options,
  810. '/admin-api/zj/code-sampling-task-details-sgjc/appSgjcUpdate',
  811. queryParameters: queryParameters,
  812. data: _data,
  813. )
  814. .copyWith(
  815. baseUrl: _combineBaseUrls(
  816. _dio.options.baseUrl,
  817. baseUrl,
  818. ))));
  819. final value = ApiRsp<bool?>.fromJson(
  820. _result.data!,
  821. (json) => json as bool?,
  822. );
  823. return value;
  824. }
  825. RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
  826. if (T != dynamic &&
  827. !(requestOptions.responseType == ResponseType.bytes ||
  828. requestOptions.responseType == ResponseType.stream)) {
  829. if (T == String) {
  830. requestOptions.responseType = ResponseType.plain;
  831. } else {
  832. requestOptions.responseType = ResponseType.json;
  833. }
  834. }
  835. return requestOptions;
  836. }
  837. String _combineBaseUrls(
  838. String dioBaseUrl,
  839. String? baseUrl,
  840. ) {
  841. if (baseUrl == null || baseUrl.trim().isEmpty) {
  842. return dioBaseUrl;
  843. }
  844. final url = Uri.parse(baseUrl);
  845. if (url.isAbsolute) {
  846. return url.toString();
  847. }
  848. return Uri.parse(dioBaseUrl).resolveUri(url).toString();
  849. }
  850. }