api.g.dart 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  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<DictRsp>>> getAllDict() async {
  105. const _extra = <String, dynamic>{};
  106. final queryParameters = <String, dynamic>{};
  107. final _headers = <String, dynamic>{};
  108. final Map<String, dynamic>? _data = null;
  109. final _result = await _dio.fetch<Map<String, dynamic>>(
  110. _setStreamType<ApiRsp<List<DictRsp>>>(Options(
  111. method: 'GET',
  112. headers: _headers,
  113. extra: _extra,
  114. )
  115. .compose(
  116. _dio.options,
  117. '/admin-api/system/dict-data/simple-list',
  118. queryParameters: queryParameters,
  119. data: _data,
  120. )
  121. .copyWith(
  122. baseUrl: _combineBaseUrls(
  123. _dio.options.baseUrl,
  124. baseUrl,
  125. ))));
  126. final value = ApiRsp<List<DictRsp>>.fromJson(
  127. _result.data!,
  128. (json) => json is List<dynamic>
  129. ? json
  130. .map<DictRsp>((i) => DictRsp.fromJson(i as Map<String, dynamic>))
  131. .toList()
  132. : List.empty(),
  133. );
  134. return value;
  135. }
  136. @override
  137. Future<ApiRsp<SampleTaskListRsp>> sampleTaskList(
  138. Map<String, dynamic> map) async {
  139. const _extra = <String, dynamic>{};
  140. final queryParameters = <String, dynamic>{};
  141. queryParameters.addAll(map);
  142. final _headers = <String, dynamic>{};
  143. final Map<String, dynamic>? _data = null;
  144. final _result = await _dio.fetch<Map<String, dynamic>>(
  145. _setStreamType<ApiRsp<SampleTaskListRsp>>(Options(
  146. method: 'GET',
  147. headers: _headers,
  148. extra: _extra,
  149. )
  150. .compose(
  151. _dio.options,
  152. '/admin-api/zj/code-sampling-task-details-sgjc/sampling_task_detail_page',
  153. queryParameters: queryParameters,
  154. data: _data,
  155. )
  156. .copyWith(
  157. baseUrl: _combineBaseUrls(
  158. _dio.options.baseUrl,
  159. baseUrl,
  160. ))));
  161. final value = ApiRsp<SampleTaskListRsp>.fromJson(
  162. _result.data!,
  163. (json) => SampleTaskListRsp.fromJson(json as Map<String, dynamic>),
  164. );
  165. return value;
  166. }
  167. @override
  168. Future<ApiRsp<String?>> getAppDownloadUrl() async {
  169. const _extra = <String, dynamic>{};
  170. final queryParameters = <String, dynamic>{};
  171. final _headers = <String, dynamic>{};
  172. final Map<String, dynamic>? _data = null;
  173. final _result = await _dio
  174. .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<String>>(Options(
  175. method: 'GET',
  176. headers: _headers,
  177. extra: _extra,
  178. )
  179. .compose(
  180. _dio.options,
  181. '/admin-api/zj/base-file/getAppDownLoadUrl',
  182. queryParameters: queryParameters,
  183. data: _data,
  184. )
  185. .copyWith(
  186. baseUrl: _combineBaseUrls(
  187. _dio.options.baseUrl,
  188. baseUrl,
  189. ))));
  190. final value = ApiRsp<String?>.fromJson(
  191. _result.data!,
  192. (json) => json as String?,
  193. );
  194. return value;
  195. }
  196. @override
  197. Future<ApiRsp<bool?>> updateSampleTaskSgjc(Map<String, dynamic> map) async {
  198. const _extra = <String, dynamic>{};
  199. final queryParameters = <String, dynamic>{};
  200. final _headers = <String, dynamic>{};
  201. final _data = <String, dynamic>{};
  202. _data.addAll(map);
  203. final _result = await _dio
  204. .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<bool>>(Options(
  205. method: 'PUT',
  206. headers: _headers,
  207. extra: _extra,
  208. )
  209. .compose(
  210. _dio.options,
  211. '/admin-api/zj/code-sampling-task-details-sgjc/update',
  212. queryParameters: queryParameters,
  213. data: _data,
  214. )
  215. .copyWith(
  216. baseUrl: _combineBaseUrls(
  217. _dio.options.baseUrl,
  218. baseUrl,
  219. ))));
  220. final value = ApiRsp<bool?>.fromJson(
  221. _result.data!,
  222. (json) => json as bool?,
  223. );
  224. return value;
  225. }
  226. @override
  227. Future<ApiRsp<bool?>> updateSampleTaskKcjc(Map<String, dynamic> map) async {
  228. const _extra = <String, dynamic>{};
  229. final queryParameters = <String, dynamic>{};
  230. final _headers = <String, dynamic>{};
  231. final _data = <String, dynamic>{};
  232. _data.addAll(map);
  233. final _result = await _dio
  234. .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<bool>>(Options(
  235. method: 'PUT',
  236. headers: _headers,
  237. extra: _extra,
  238. )
  239. .compose(
  240. _dio.options,
  241. '/admin-api/zj/code-sampling-task-details-kcjc/update',
  242. queryParameters: queryParameters,
  243. data: _data,
  244. )
  245. .copyWith(
  246. baseUrl: _combineBaseUrls(
  247. _dio.options.baseUrl,
  248. baseUrl,
  249. ))));
  250. final value = ApiRsp<bool?>.fromJson(
  251. _result.data!,
  252. (json) => json as bool?,
  253. );
  254. return value;
  255. }
  256. @override
  257. Future<ApiRsp<SampleTaskItem?>> sampleTaskDetailSgjc(num id) async {
  258. const _extra = <String, dynamic>{};
  259. final queryParameters = <String, dynamic>{r'id': id};
  260. final _headers = <String, dynamic>{};
  261. final Map<String, dynamic>? _data = null;
  262. final _result = await _dio.fetch<Map<String, dynamic>>(
  263. _setStreamType<ApiRsp<SampleTaskItem>>(Options(
  264. method: 'GET',
  265. headers: _headers,
  266. extra: _extra,
  267. )
  268. .compose(
  269. _dio.options,
  270. '/admin-api/zj/code-sampling-task-details-sgjc/getSamplingTaskDetails',
  271. queryParameters: queryParameters,
  272. data: _data,
  273. )
  274. .copyWith(
  275. baseUrl: _combineBaseUrls(
  276. _dio.options.baseUrl,
  277. baseUrl,
  278. ))));
  279. final value = ApiRsp<SampleTaskItem?>.fromJson(
  280. _result.data!,
  281. (json) => json == null
  282. ? null
  283. : SampleTaskItem.fromJson(json as Map<String, dynamic>),
  284. );
  285. return value;
  286. }
  287. @override
  288. Future<ApiRsp<SampleTaskItemKcjcRsp?>> sampleTaskDetailKcjc(num id) async {
  289. const _extra = <String, dynamic>{};
  290. final queryParameters = <String, dynamic>{r'id': id};
  291. final _headers = <String, dynamic>{};
  292. final Map<String, dynamic>? _data = null;
  293. final _result = await _dio.fetch<Map<String, dynamic>>(
  294. _setStreamType<ApiRsp<SampleTaskItemKcjcRsp>>(Options(
  295. method: 'GET',
  296. headers: _headers,
  297. extra: _extra,
  298. )
  299. .compose(
  300. _dio.options,
  301. '/admin-api/zj/code-sampling-task-details-kcjc/get',
  302. queryParameters: queryParameters,
  303. data: _data,
  304. )
  305. .copyWith(
  306. baseUrl: _combineBaseUrls(
  307. _dio.options.baseUrl,
  308. baseUrl,
  309. ))));
  310. final value = ApiRsp<SampleTaskItemKcjcRsp?>.fromJson(
  311. _result.data!,
  312. (json) => json == null
  313. ? null
  314. : SampleTaskItemKcjcRsp.fromJson(json as Map<String, dynamic>),
  315. );
  316. return value;
  317. }
  318. @override
  319. Future<ApiRsp<List<TrxxRsp>?>> trxxList() async {
  320. const _extra = <String, dynamic>{};
  321. final queryParameters = <String, dynamic>{};
  322. final _headers = <String, dynamic>{};
  323. final Map<String, dynamic>? _data = null;
  324. final _result = await _dio.fetch<Map<String, dynamic>>(
  325. _setStreamType<ApiRsp<List<TrxxRsp>>>(Options(
  326. method: 'GET',
  327. headers: _headers,
  328. extra: _extra,
  329. )
  330. .compose(
  331. _dio.options,
  332. '/admin-api/zj/base-soil-information/trxxxz',
  333. queryParameters: queryParameters,
  334. data: _data,
  335. )
  336. .copyWith(
  337. baseUrl: _combineBaseUrls(
  338. _dio.options.baseUrl,
  339. baseUrl,
  340. ))));
  341. final value = ApiRsp<List<TrxxRsp>>.fromJson(
  342. _result.data!,
  343. (json) => json is List<dynamic>
  344. ? json
  345. .map<TrxxRsp>((i) => TrxxRsp.fromJson(i as Map<String, dynamic>))
  346. .toList()
  347. : List.empty(),
  348. );
  349. return value;
  350. }
  351. @override
  352. Future<ApiRsp<List<LsxxRsp>?>> lsxxList(String zlmc) async {
  353. const _extra = <String, dynamic>{};
  354. final queryParameters = <String, dynamic>{r'zlmc': zlmc};
  355. final _headers = <String, dynamic>{};
  356. final Map<String, dynamic>? _data = null;
  357. final _result = await _dio.fetch<Map<String, dynamic>>(
  358. _setStreamType<ApiRsp<List<LsxxRsp>>>(Options(
  359. method: 'GET',
  360. headers: _headers,
  361. extra: _extra,
  362. )
  363. .compose(
  364. _dio.options,
  365. '/admin-api/zj/base-grain-information/lsxxfl',
  366. queryParameters: queryParameters,
  367. data: _data,
  368. )
  369. .copyWith(
  370. baseUrl: _combineBaseUrls(
  371. _dio.options.baseUrl,
  372. baseUrl,
  373. ))));
  374. final value = ApiRsp<List<LsxxRsp>>.fromJson(
  375. _result.data!,
  376. (json) => json is List<dynamic>
  377. ? json
  378. .map<LsxxRsp>((i) => LsxxRsp.fromJson(i as Map<String, dynamic>))
  379. .toList()
  380. : List.empty(),
  381. );
  382. return value;
  383. }
  384. @override
  385. Future<ApiRsp<num?>> receiveSampleTaskSgjc(num id) async {
  386. const _extra = <String, dynamic>{};
  387. final queryParameters = <String, dynamic>{r'id': id};
  388. final _headers = <String, dynamic>{};
  389. final Map<String, dynamic>? _data = null;
  390. final _result = await _dio
  391. .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<num>>(Options(
  392. method: 'GET',
  393. headers: _headers,
  394. extra: _extra,
  395. )
  396. .compose(
  397. _dio.options,
  398. '/admin-api/zj/code-sampling-task-details-sgjc/updateStatus',
  399. queryParameters: queryParameters,
  400. data: _data,
  401. )
  402. .copyWith(
  403. baseUrl: _combineBaseUrls(
  404. _dio.options.baseUrl,
  405. baseUrl,
  406. ))));
  407. final value = ApiRsp<num?>.fromJson(
  408. _result.data!,
  409. (json) => json as num?,
  410. );
  411. return value;
  412. }
  413. @override
  414. Future<ApiRsp<List<PersonRsp>?>> getPersonMenu(num jhcyjg) async {
  415. const _extra = <String, dynamic>{};
  416. final queryParameters = <String, dynamic>{r'jhcyjg': jhcyjg};
  417. final _headers = <String, dynamic>{};
  418. final Map<String, dynamic>? _data = null;
  419. final _result = await _dio.fetch<Map<String, dynamic>>(
  420. _setStreamType<ApiRsp<List<PersonRsp>>>(Options(
  421. method: 'GET',
  422. headers: _headers,
  423. extra: _extra,
  424. )
  425. .compose(
  426. _dio.options,
  427. '/admin-api/zj/base-personnel/selectByJhcyjg',
  428. queryParameters: queryParameters,
  429. data: _data,
  430. )
  431. .copyWith(
  432. baseUrl: _combineBaseUrls(
  433. _dio.options.baseUrl,
  434. baseUrl,
  435. ))));
  436. final value = ApiRsp<List<PersonRsp>>.fromJson(
  437. _result.data!,
  438. (json) => json is List<dynamic>
  439. ? json
  440. .map<PersonRsp>(
  441. (i) => PersonRsp.fromJson(i as Map<String, dynamic>))
  442. .toList()
  443. : List.empty(),
  444. );
  445. return value;
  446. }
  447. @override
  448. Future<ApiRsp<List<DistrictRsp>?>> districtList(
  449. num uLevel, {
  450. num? id,
  451. }) async {
  452. const _extra = <String, dynamic>{};
  453. final queryParameters = <String, dynamic>{
  454. r'uLevel': uLevel,
  455. r'id': id,
  456. };
  457. queryParameters.removeWhere((k, v) => v == null);
  458. final _headers = <String, dynamic>{};
  459. final Map<String, dynamic>? _data = null;
  460. final _result = await _dio.fetch<Map<String, dynamic>>(
  461. _setStreamType<ApiRsp<List<DistrictRsp>>>(Options(
  462. method: 'GET',
  463. headers: _headers,
  464. extra: _extra,
  465. )
  466. .compose(
  467. _dio.options,
  468. '/admin-api/zj/base-administrative-division/list',
  469. queryParameters: queryParameters,
  470. data: _data,
  471. )
  472. .copyWith(
  473. baseUrl: _combineBaseUrls(
  474. _dio.options.baseUrl,
  475. baseUrl,
  476. ))));
  477. final value = ApiRsp<List<DistrictRsp>>.fromJson(
  478. _result.data!,
  479. (json) => json is List<dynamic>
  480. ? json
  481. .map<DistrictRsp>(
  482. (i) => DistrictRsp.fromJson(i as Map<String, dynamic>))
  483. .toList()
  484. : List.empty(),
  485. );
  486. return value;
  487. }
  488. @override
  489. Future<ApiRsp<String?>> upload(File file) async {
  490. const _extra = <String, dynamic>{};
  491. final queryParameters = <String, dynamic>{};
  492. final _headers = <String, dynamic>{};
  493. final _data = FormData();
  494. _data.files.add(MapEntry(
  495. 'file',
  496. MultipartFile.fromFileSync(
  497. file.path,
  498. filename: file.path.split(Platform.pathSeparator).last,
  499. ),
  500. ));
  501. final _result = await _dio
  502. .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<String>>(Options(
  503. method: 'POST',
  504. headers: _headers,
  505. extra: _extra,
  506. )
  507. .compose(
  508. _dio.options,
  509. '/admin-api/infra/file/upload',
  510. queryParameters: queryParameters,
  511. data: _data,
  512. )
  513. .copyWith(
  514. baseUrl: _combineBaseUrls(
  515. _dio.options.baseUrl,
  516. baseUrl,
  517. ))));
  518. final value = ApiRsp<String?>.fromJson(
  519. _result.data!,
  520. (json) => json as String?,
  521. );
  522. return value;
  523. }
  524. @override
  525. Future<ApiRsp<dynamic>> postDeviceInfos(List<DeviceReq> req) async {
  526. const _extra = <String, dynamic>{};
  527. final queryParameters = <String, dynamic>{};
  528. final _headers = <String, dynamic>{};
  529. final _data = req.map((e) => e.toJson()).toList();
  530. final _result = await _dio
  531. .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<dynamic>>(Options(
  532. method: 'POST',
  533. headers: _headers,
  534. extra: _extra,
  535. )
  536. .compose(
  537. _dio.options,
  538. '/admin-api/zj/base-device/createBatch',
  539. queryParameters: queryParameters,
  540. data: _data,
  541. )
  542. .copyWith(
  543. baseUrl: _combineBaseUrls(
  544. _dio.options.baseUrl,
  545. baseUrl,
  546. ))));
  547. final value = ApiRsp<dynamic>.fromJson(
  548. _result.data!,
  549. (json) => json as dynamic,
  550. );
  551. return value;
  552. }
  553. RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
  554. if (T != dynamic &&
  555. !(requestOptions.responseType == ResponseType.bytes ||
  556. requestOptions.responseType == ResponseType.stream)) {
  557. if (T == String) {
  558. requestOptions.responseType = ResponseType.plain;
  559. } else {
  560. requestOptions.responseType = ResponseType.json;
  561. }
  562. }
  563. return requestOptions;
  564. }
  565. String _combineBaseUrls(
  566. String dioBaseUrl,
  567. String? baseUrl,
  568. ) {
  569. if (baseUrl == null || baseUrl.trim().isEmpty) {
  570. return dioBaseUrl;
  571. }
  572. final url = Uri.parse(baseUrl);
  573. if (url.isAbsolute) {
  574. return url.toString();
  575. }
  576. return Uri.parse(dioBaseUrl).resolveUri(url).toString();
  577. }
  578. }