123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607 |
- // GENERATED CODE - DO NOT MODIFY BY HAND
- part of 'api.dart';
- // **************************************************************************
- // RetrofitGenerator
- // **************************************************************************
- // ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers
- class _Api implements Api {
- _Api(
- this._dio, {
- this.baseUrl,
- });
- final Dio _dio;
- String? baseUrl;
- @override
- Future<ApiRsp<LoginRsp>> login(LoginReq req) async {
- const _extra = <String, dynamic>{};
- final queryParameters = <String, dynamic>{};
- final _headers = <String, dynamic>{};
- final _data = <String, dynamic>{};
- _data.addAll(req.toJson());
- final _result = await _dio
- .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<LoginRsp>>(Options(
- method: 'POST',
- headers: _headers,
- extra: _extra,
- )
- .compose(
- _dio.options,
- '/admin-api/system/auth/login',
- queryParameters: queryParameters,
- data: _data,
- )
- .copyWith(
- baseUrl: _combineBaseUrls(
- _dio.options.baseUrl,
- baseUrl,
- ))));
- final value = ApiRsp<LoginRsp>.fromJson(
- _result.data!,
- (json) => LoginRsp.fromJson(json as Map<String, dynamic>),
- );
- return value;
- }
- @override
- Future<ApiRsp<UserRsp>> userProfile() async {
- const _extra = <String, dynamic>{};
- final queryParameters = <String, dynamic>{};
- final _headers = <String, dynamic>{};
- final Map<String, dynamic>? _data = null;
- final _result = await _dio
- .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<UserRsp>>(Options(
- method: 'GET',
- headers: _headers,
- extra: _extra,
- )
- .compose(
- _dio.options,
- '/admin-api/system/user/profile/get',
- queryParameters: queryParameters,
- data: _data,
- )
- .copyWith(
- baseUrl: _combineBaseUrls(
- _dio.options.baseUrl,
- baseUrl,
- ))));
- final value = ApiRsp<UserRsp>.fromJson(
- _result.data!,
- (json) => UserRsp.fromJson(json as Map<String, dynamic>),
- );
- return value;
- }
- @override
- Future<ApiRsp<bool>> updatePassword(Map<String, dynamic> map) async {
- const _extra = <String, dynamic>{};
- final queryParameters = <String, dynamic>{};
- final _headers = <String, dynamic>{};
- final _data = <String, dynamic>{};
- _data.addAll(map);
- final _result = await _dio
- .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<bool>>(Options(
- method: 'PUT',
- headers: _headers,
- extra: _extra,
- )
- .compose(
- _dio.options,
- '/admin-api/system/user/profile/update-password',
- queryParameters: queryParameters,
- data: _data,
- )
- .copyWith(
- baseUrl: _combineBaseUrls(
- _dio.options.baseUrl,
- baseUrl,
- ))));
- final value = ApiRsp<bool>.fromJson(
- _result.data!,
- (json) => json as bool,
- );
- return value;
- }
- @override
- Future<ApiRsp<List<DictRsp>>> getAllDict() async {
- const _extra = <String, dynamic>{};
- final queryParameters = <String, dynamic>{};
- final _headers = <String, dynamic>{};
- final Map<String, dynamic>? _data = null;
- final _result = await _dio.fetch<Map<String, dynamic>>(
- _setStreamType<ApiRsp<List<DictRsp>>>(Options(
- method: 'GET',
- headers: _headers,
- extra: _extra,
- )
- .compose(
- _dio.options,
- '/admin-api/system/dict-data/simple-list',
- queryParameters: queryParameters,
- data: _data,
- )
- .copyWith(
- baseUrl: _combineBaseUrls(
- _dio.options.baseUrl,
- baseUrl,
- ))));
- final value = ApiRsp<List<DictRsp>>.fromJson(
- _result.data!,
- (json) => json is List<dynamic>
- ? json
- .map<DictRsp>((i) => DictRsp.fromJson(i as Map<String, dynamic>))
- .toList()
- : List.empty(),
- );
- return value;
- }
- @override
- Future<ApiRsp<SampleTaskListRsp>> sampleTaskList(
- Map<String, dynamic> map) async {
- const _extra = <String, dynamic>{};
- final queryParameters = <String, dynamic>{};
- queryParameters.addAll(map);
- final _headers = <String, dynamic>{};
- final Map<String, dynamic>? _data = null;
- final _result = await _dio.fetch<Map<String, dynamic>>(
- _setStreamType<ApiRsp<SampleTaskListRsp>>(Options(
- method: 'GET',
- headers: _headers,
- extra: _extra,
- )
- .compose(
- _dio.options,
- '/admin-api/zj/code-sampling-task-details-sgjc/sampling_task_detail_page',
- queryParameters: queryParameters,
- data: _data,
- )
- .copyWith(
- baseUrl: _combineBaseUrls(
- _dio.options.baseUrl,
- baseUrl,
- ))));
- final value = ApiRsp<SampleTaskListRsp>.fromJson(
- _result.data!,
- (json) => SampleTaskListRsp.fromJson(json as Map<String, dynamic>),
- );
- return value;
- }
- @override
- Future<ApiRsp<String?>> getAppDownloadUrl() async {
- const _extra = <String, dynamic>{};
- final queryParameters = <String, dynamic>{};
- final _headers = <String, dynamic>{};
- final Map<String, dynamic>? _data = null;
- final _result = await _dio
- .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<String>>(Options(
- method: 'GET',
- headers: _headers,
- extra: _extra,
- )
- .compose(
- _dio.options,
- '/admin-api/zj/base-file/getAppDownLoadUrl',
- queryParameters: queryParameters,
- data: _data,
- )
- .copyWith(
- baseUrl: _combineBaseUrls(
- _dio.options.baseUrl,
- baseUrl,
- ))));
- final value = ApiRsp<String?>.fromJson(
- _result.data!,
- (json) => json as String?,
- );
- return value;
- }
- @override
- Future<ApiRsp<bool?>> updateSampleTaskSgjc(Map<String, dynamic> map) async {
- const _extra = <String, dynamic>{};
- final queryParameters = <String, dynamic>{};
- final _headers = <String, dynamic>{};
- final _data = <String, dynamic>{};
- _data.addAll(map);
- final _result = await _dio
- .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<bool>>(Options(
- method: 'PUT',
- headers: _headers,
- extra: _extra,
- )
- .compose(
- _dio.options,
- '/admin-api/zj/code-sampling-task-details-sgjc/update',
- queryParameters: queryParameters,
- data: _data,
- )
- .copyWith(
- baseUrl: _combineBaseUrls(
- _dio.options.baseUrl,
- baseUrl,
- ))));
- final value = ApiRsp<bool?>.fromJson(
- _result.data!,
- (json) => json as bool?,
- );
- return value;
- }
- @override
- Future<ApiRsp<bool?>> updateSampleTaskKcjc(Map<String, dynamic> map) async {
- const _extra = <String, dynamic>{};
- final queryParameters = <String, dynamic>{};
- final _headers = <String, dynamic>{};
- final _data = <String, dynamic>{};
- _data.addAll(map);
- final _result = await _dio
- .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<bool>>(Options(
- method: 'PUT',
- headers: _headers,
- extra: _extra,
- )
- .compose(
- _dio.options,
- '/admin-api/zj/code-sampling-task-details-kcjc/update',
- queryParameters: queryParameters,
- data: _data,
- )
- .copyWith(
- baseUrl: _combineBaseUrls(
- _dio.options.baseUrl,
- baseUrl,
- ))));
- final value = ApiRsp<bool?>.fromJson(
- _result.data!,
- (json) => json as bool?,
- );
- return value;
- }
- @override
- Future<ApiRsp<SampleTaskItem?>> sampleTaskDetailSgjc(num id) async {
- const _extra = <String, dynamic>{};
- final queryParameters = <String, dynamic>{r'id': id};
- final _headers = <String, dynamic>{};
- final Map<String, dynamic>? _data = null;
- final _result = await _dio.fetch<Map<String, dynamic>>(
- _setStreamType<ApiRsp<SampleTaskItem>>(Options(
- method: 'GET',
- headers: _headers,
- extra: _extra,
- )
- .compose(
- _dio.options,
- '/admin-api/zj/code-sampling-task-details-sgjc/getSamplingTaskDetails',
- queryParameters: queryParameters,
- data: _data,
- )
- .copyWith(
- baseUrl: _combineBaseUrls(
- _dio.options.baseUrl,
- baseUrl,
- ))));
- final value = ApiRsp<SampleTaskItem?>.fromJson(
- _result.data!,
- (json) => json == null
- ? null
- : SampleTaskItem.fromJson(json as Map<String, dynamic>),
- );
- return value;
- }
- @override
- Future<ApiRsp<SampleTaskItemKcjcRsp?>> sampleTaskDetailKcjc(num id) async {
- const _extra = <String, dynamic>{};
- final queryParameters = <String, dynamic>{r'id': id};
- final _headers = <String, dynamic>{};
- final Map<String, dynamic>? _data = null;
- final _result = await _dio.fetch<Map<String, dynamic>>(
- _setStreamType<ApiRsp<SampleTaskItemKcjcRsp>>(Options(
- method: 'GET',
- headers: _headers,
- extra: _extra,
- )
- .compose(
- _dio.options,
- '/admin-api/zj/code-sampling-task-details-kcjc/get',
- queryParameters: queryParameters,
- data: _data,
- )
- .copyWith(
- baseUrl: _combineBaseUrls(
- _dio.options.baseUrl,
- baseUrl,
- ))));
- final value = ApiRsp<SampleTaskItemKcjcRsp?>.fromJson(
- _result.data!,
- (json) => json == null
- ? null
- : SampleTaskItemKcjcRsp.fromJson(json as Map<String, dynamic>),
- );
- return value;
- }
- @override
- Future<ApiRsp<List<TrxxRsp>?>> trxxList() async {
- const _extra = <String, dynamic>{};
- final queryParameters = <String, dynamic>{};
- final _headers = <String, dynamic>{};
- final Map<String, dynamic>? _data = null;
- final _result = await _dio.fetch<Map<String, dynamic>>(
- _setStreamType<ApiRsp<List<TrxxRsp>>>(Options(
- method: 'GET',
- headers: _headers,
- extra: _extra,
- )
- .compose(
- _dio.options,
- '/admin-api/zj/base-soil-information/trxxxz',
- queryParameters: queryParameters,
- data: _data,
- )
- .copyWith(
- baseUrl: _combineBaseUrls(
- _dio.options.baseUrl,
- baseUrl,
- ))));
- final value = ApiRsp<List<TrxxRsp>>.fromJson(
- _result.data!,
- (json) => json is List<dynamic>
- ? json
- .map<TrxxRsp>((i) => TrxxRsp.fromJson(i as Map<String, dynamic>))
- .toList()
- : List.empty(),
- );
- return value;
- }
- @override
- Future<ApiRsp<List<LsxxRsp>?>> lsxxList(String zlmc) async {
- const _extra = <String, dynamic>{};
- final queryParameters = <String, dynamic>{r'zlmc': zlmc};
- final _headers = <String, dynamic>{};
- final Map<String, dynamic>? _data = null;
- final _result = await _dio.fetch<Map<String, dynamic>>(
- _setStreamType<ApiRsp<List<LsxxRsp>>>(Options(
- method: 'GET',
- headers: _headers,
- extra: _extra,
- )
- .compose(
- _dio.options,
- '/admin-api/zj/base-grain-information/lsxxfl',
- queryParameters: queryParameters,
- data: _data,
- )
- .copyWith(
- baseUrl: _combineBaseUrls(
- _dio.options.baseUrl,
- baseUrl,
- ))));
- final value = ApiRsp<List<LsxxRsp>>.fromJson(
- _result.data!,
- (json) => json is List<dynamic>
- ? json
- .map<LsxxRsp>((i) => LsxxRsp.fromJson(i as Map<String, dynamic>))
- .toList()
- : List.empty(),
- );
- return value;
- }
- @override
- Future<ApiRsp<num?>> receiveSampleTaskSgjc(num id) async {
- const _extra = <String, dynamic>{};
- final queryParameters = <String, dynamic>{r'id': id};
- final _headers = <String, dynamic>{};
- final Map<String, dynamic>? _data = null;
- final _result = await _dio
- .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<num>>(Options(
- method: 'GET',
- headers: _headers,
- extra: _extra,
- )
- .compose(
- _dio.options,
- '/admin-api/zj/code-sampling-task-details-sgjc/updateStatus',
- queryParameters: queryParameters,
- data: _data,
- )
- .copyWith(
- baseUrl: _combineBaseUrls(
- _dio.options.baseUrl,
- baseUrl,
- ))));
- final value = ApiRsp<num?>.fromJson(
- _result.data!,
- (json) => json as num?,
- );
- return value;
- }
- @override
- Future<ApiRsp<List<PersonRsp>?>> getPersonMenu(num jhcyjg) async {
- const _extra = <String, dynamic>{};
- final queryParameters = <String, dynamic>{r'jhcyjg': jhcyjg};
- final _headers = <String, dynamic>{};
- final Map<String, dynamic>? _data = null;
- final _result = await _dio.fetch<Map<String, dynamic>>(
- _setStreamType<ApiRsp<List<PersonRsp>>>(Options(
- method: 'GET',
- headers: _headers,
- extra: _extra,
- )
- .compose(
- _dio.options,
- '/admin-api/zj/base-personnel/selectByJhcyjg',
- queryParameters: queryParameters,
- data: _data,
- )
- .copyWith(
- baseUrl: _combineBaseUrls(
- _dio.options.baseUrl,
- baseUrl,
- ))));
- final value = ApiRsp<List<PersonRsp>>.fromJson(
- _result.data!,
- (json) => json is List<dynamic>
- ? json
- .map<PersonRsp>(
- (i) => PersonRsp.fromJson(i as Map<String, dynamic>))
- .toList()
- : List.empty(),
- );
- return value;
- }
- @override
- Future<ApiRsp<List<DistrictRsp>?>> districtList(
- num uLevel, {
- num? id,
- }) async {
- const _extra = <String, dynamic>{};
- final queryParameters = <String, dynamic>{
- r'uLevel': uLevel,
- r'id': id,
- };
- queryParameters.removeWhere((k, v) => v == null);
- final _headers = <String, dynamic>{};
- final Map<String, dynamic>? _data = null;
- final _result = await _dio.fetch<Map<String, dynamic>>(
- _setStreamType<ApiRsp<List<DistrictRsp>>>(Options(
- method: 'GET',
- headers: _headers,
- extra: _extra,
- )
- .compose(
- _dio.options,
- '/admin-api/zj/base-administrative-division/list',
- queryParameters: queryParameters,
- data: _data,
- )
- .copyWith(
- baseUrl: _combineBaseUrls(
- _dio.options.baseUrl,
- baseUrl,
- ))));
- final value = ApiRsp<List<DistrictRsp>>.fromJson(
- _result.data!,
- (json) => json is List<dynamic>
- ? json
- .map<DistrictRsp>(
- (i) => DistrictRsp.fromJson(i as Map<String, dynamic>))
- .toList()
- : List.empty(),
- );
- return value;
- }
- @override
- Future<ApiRsp<String?>> upload(File file) async {
- const _extra = <String, dynamic>{};
- final queryParameters = <String, dynamic>{};
- final _headers = <String, dynamic>{};
- final _data = FormData();
- _data.files.add(MapEntry(
- 'file',
- MultipartFile.fromFileSync(
- file.path,
- filename: file.path.split(Platform.pathSeparator).last,
- ),
- ));
- final _result = await _dio
- .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<String>>(Options(
- method: 'POST',
- headers: _headers,
- extra: _extra,
- )
- .compose(
- _dio.options,
- '/admin-api/infra/file/upload',
- queryParameters: queryParameters,
- data: _data,
- )
- .copyWith(
- baseUrl: _combineBaseUrls(
- _dio.options.baseUrl,
- baseUrl,
- ))));
- final value = ApiRsp<String?>.fromJson(
- _result.data!,
- (json) => json as String?,
- );
- return value;
- }
- @override
- Future<ApiRsp<dynamic>> postDeviceInfos(List<DeviceReq> req) async {
- const _extra = <String, dynamic>{};
- final queryParameters = <String, dynamic>{};
- final _headers = <String, dynamic>{};
- final _data = req.map((e) => e.toJson()).toList();
- final _result = await _dio
- .fetch<Map<String, dynamic>>(_setStreamType<ApiRsp<dynamic>>(Options(
- method: 'POST',
- headers: _headers,
- extra: _extra,
- )
- .compose(
- _dio.options,
- '/admin-api/zj/base-device/createBatch',
- queryParameters: queryParameters,
- data: _data,
- )
- .copyWith(
- baseUrl: _combineBaseUrls(
- _dio.options.baseUrl,
- baseUrl,
- ))));
- final value = ApiRsp<dynamic>.fromJson(
- _result.data!,
- (json) => json as dynamic,
- );
- return value;
- }
- RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
- if (T != dynamic &&
- !(requestOptions.responseType == ResponseType.bytes ||
- requestOptions.responseType == ResponseType.stream)) {
- if (T == String) {
- requestOptions.responseType = ResponseType.plain;
- } else {
- requestOptions.responseType = ResponseType.json;
- }
- }
- return requestOptions;
- }
- String _combineBaseUrls(
- String dioBaseUrl,
- String? baseUrl,
- ) {
- if (baseUrl == null || baseUrl.trim().isEmpty) {
- return dioBaseUrl;
- }
- final url = Uri.parse(baseUrl);
- if (url.isAbsolute) {
- return url.toString();
- }
- return Uri.parse(dioBaseUrl).resolveUri(url).toString();
- }
- }
|