api.g.dart 17 KB

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