// 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> login(LoginReq req) async { const _extra = {}; final queryParameters = {}; final _headers = {}; final _data = {}; _data.addAll(req.toJson()); final _result = await _dio .fetch>(_setStreamType>(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.fromJson( _result.data!, (json) => LoginRsp.fromJson(json as Map), ); return value; } @override Future> userProfile() async { const _extra = {}; final queryParameters = {}; final _headers = {}; final Map? _data = null; final _result = await _dio .fetch>(_setStreamType>(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.fromJson( _result.data!, (json) => UserRsp.fromJson(json as Map), ); return value; } @override Future> updatePassword(Map map) async { const _extra = {}; final queryParameters = {}; final _headers = {}; final _data = {}; _data.addAll(map); final _result = await _dio .fetch>(_setStreamType>(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.fromJson( _result.data!, (json) => json as bool, ); return value; } @override Future>> getStoreMessage( String ajbm, String key, ) async { const _extra = {}; final queryParameters = { r'ajbm': ajbm, r'key': key, }; final _headers = {}; final Map? _data = null; final _result = await _dio.fetch>( _setStreamType>>(Options( method: 'GET', headers: _headers, extra: _extra, ) .compose( _dio.options, '/admin-api/coding/fmxx/queryLsxxList', queryParameters: queryParameters, data: _data, ) .copyWith( baseUrl: _combineBaseUrls( _dio.options.baseUrl, baseUrl, )))); final value = ApiRsp>.fromJson( _result.data!, (json) => json is List ? json .map( (i) => storehouseRsp.fromJson(i as Map)) .toList() : List.empty(), ); return value; } @override Future>> getAllDict() async { const _extra = {}; final queryParameters = {}; final _headers = {}; final Map? _data = null; final _result = await _dio.fetch>( _setStreamType>>(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>.fromJson( _result.data!, (json) => json is List ? json .map((i) => DictRsp.fromJson(i as Map)) .toList() : List.empty(), ); return value; } @override Future> sampleTaskList( Map map) async { const _extra = {}; final queryParameters = {}; queryParameters.addAll(map); final _headers = {}; final Map? _data = null; final _result = await _dio.fetch>( _setStreamType>(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.fromJson( _result.data!, (json) => SampleTaskListRsp.fromJson(json as Map), ); return value; } @override Future> getAppDownloadUrl() async { const _extra = {}; final queryParameters = {}; final _headers = {}; final Map? _data = null; final _result = await _dio .fetch>(_setStreamType>(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.fromJson( _result.data!, (json) => json as String?, ); return value; } @override Future> getAppDownLoadUrlAndName() async { const _extra = {}; final queryParameters = {}; final _headers = {}; final Map? _data = null; final _result = await _dio .fetch>(_setStreamType>(Options( method: 'GET', headers: _headers, extra: _extra, ) .compose( _dio.options, '/admin-api/zj/base-file/getAppDownLoadUrlAndName', queryParameters: queryParameters, data: _data, ) .copyWith( baseUrl: _combineBaseUrls( _dio.options.baseUrl, baseUrl, )))); final value = ApiRsp.fromJson( _result.data!, (json) => json == null ? null : UrlItem.fromJson(json as Map), ); return value; } @override Future> updateSampleTaskSgjc( Map map) async { const _extra = {}; final queryParameters = {}; final _headers = {}; final _data = {}; _data.addAll(map); final _result = await _dio.fetch>( _setStreamType>(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.fromJson( _result.data!, (json) => json == null ? null : DeviationLoactionRsp.fromJson(json as Map), ); return value; } @override Future> updateSampleTaskKcjc(Map map) async { const _extra = {}; final queryParameters = {}; final _headers = {}; final _data = {}; _data.addAll(map); final _result = await _dio .fetch>(_setStreamType>(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.fromJson( _result.data!, (json) => json as bool?, ); return value; } @override Future> sampleTaskDetailSgjc(num id) async { const _extra = {}; final queryParameters = {r'id': id}; final _headers = {}; final Map? _data = null; final _result = await _dio.fetch>( _setStreamType>(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.fromJson( _result.data!, (json) => json == null ? null : SampleTaskItem.fromJson(json as Map), ); return value; } @override Future> sampleTaskDetailKcjc(num id) async { const _extra = {}; final queryParameters = {r'id': id}; final _headers = {}; final Map? _data = null; final _result = await _dio.fetch>( _setStreamType>(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.fromJson( _result.data!, (json) => json == null ? null : SampleTaskItemKcjcRsp.fromJson(json as Map), ); return value; } @override Future?>> trxxList() async { const _extra = {}; final queryParameters = {}; final _headers = {}; final Map? _data = null; final _result = await _dio.fetch>( _setStreamType>>(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>.fromJson( _result.data!, (json) => json is List ? json .map((i) => TrxxRsp.fromJson(i as Map)) .toList() : List.empty(), ); return value; } @override Future?>> lsxxList(String zlmc) async { const _extra = {}; final queryParameters = {r'zlmc': zlmc}; final _headers = {}; final Map? _data = null; final _result = await _dio.fetch>( _setStreamType>>(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>.fromJson( _result.data!, (json) => json is List ? json .map((i) => LsxxRsp.fromJson(i as Map)) .toList() : List.empty(), ); return value; } @override Future> receiveSampleTaskSgjc(num id) async { const _extra = {}; final queryParameters = {r'id': id}; final _headers = {}; final Map? _data = null; final _result = await _dio .fetch>(_setStreamType>(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.fromJson( _result.data!, (json) => json as num?, ); return value; } @override Future?>> getPersonMenu(num jhcyjg) async { const _extra = {}; final queryParameters = {r'jhcyjg': jhcyjg}; final _headers = {}; final Map? _data = null; final _result = await _dio.fetch>( _setStreamType>>(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>.fromJson( _result.data!, (json) => json is List ? json .map( (i) => PersonRsp.fromJson(i as Map)) .toList() : List.empty(), ); return value; } @override Future?>> districtList( num uLevel, { num? id, }) async { const _extra = {}; final queryParameters = { r'uLevel': uLevel, r'id': id, }; queryParameters.removeWhere((k, v) => v == null); final _headers = {}; final Map? _data = null; final _result = await _dio.fetch>( _setStreamType>>(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>.fromJson( _result.data!, (json) => json is List ? json .map( (i) => DistrictRsp.fromJson(i as Map)) .toList() : List.empty(), ); return value; } @override Future> upload(File file) async { const _extra = {}; final queryParameters = {}; final _headers = {}; final _data = FormData(); _data.files.add(MapEntry( 'file', MultipartFile.fromFileSync( file.path, filename: file.path.split(Platform.pathSeparator).last, ), )); final _result = await _dio .fetch>(_setStreamType>(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.fromJson( _result.data!, (json) => json as String?, ); return value; } @override Future> postDeviceInfos(List req) async { const _extra = {}; final queryParameters = {}; final _headers = {}; final _data = req.map((e) => e.toJson()).toList(); final _result = await _dio .fetch>(_setStreamType>(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.fromJson( _result.data!, (json) => json as dynamic, ); return value; } @override Future> postPhoneMsg(Map map) async { const _extra = {}; final queryParameters = {}; final _headers = {}; final _data = {}; _data.addAll(map); final _result = await _dio .fetch>(_setStreamType>(Options( method: 'POST', headers: _headers, extra: _extra, ) .compose( _dio.options, '/admin-api/system/auth/reset_password_send_sms_code', queryParameters: queryParameters, data: _data, ) .copyWith( baseUrl: _combineBaseUrls( _dio.options.baseUrl, baseUrl, )))); final value = ApiRsp.fromJson( _result.data!, (json) => json as bool?, ); return value; } @override Future> loginWithPhoneMsg(Map map) async { const _extra = {}; final queryParameters = {}; final _headers = {}; final _data = {}; _data.addAll(map); final _result = await _dio .fetch>(_setStreamType>(Options( method: 'POST', headers: _headers, extra: _extra, ) .compose( _dio.options, '/admin-api/system/auth/send-sms-code', queryParameters: queryParameters, data: _data, ) .copyWith( baseUrl: _combineBaseUrls( _dio.options.baseUrl, baseUrl, )))); final value = ApiRsp.fromJson( _result.data!, (json) => json as bool?, ); return value; } @override Future> smsLogin(Map map) async { const _extra = {}; final queryParameters = {}; final _headers = {}; final _data = {}; _data.addAll(map); final _result = await _dio .fetch>(_setStreamType>(Options( method: 'POST', headers: _headers, extra: _extra, ) .compose( _dio.options, '/admin-api/system/auth/sms-login', queryParameters: queryParameters, data: _data, ) .copyWith( baseUrl: _combineBaseUrls( _dio.options.baseUrl, baseUrl, )))); final value = ApiRsp.fromJson( _result.data!, (json) => LoginRsp.fromJson(json as Map), ); return value; } @override Future> resetPassword(Map map) async { const _extra = {}; final queryParameters = {}; final _headers = {}; final _data = {}; _data.addAll(map); final _result = await _dio .fetch>(_setStreamType>(Options( method: 'POST', headers: _headers, extra: _extra, ) .compose( _dio.options, '/admin-api/system/auth/reset_password', queryParameters: queryParameters, data: _data, ) .copyWith( baseUrl: _combineBaseUrls( _dio.options.baseUrl, baseUrl, )))); final value = ApiRsp.fromJson( _result.data!, (json) => json as bool?, ); return value; } @override Future?>> stockPoints({ double? width, double? length, double? height, double? partitionSize, bool? randomOffset, double? offsetRange, }) async { const _extra = {}; final queryParameters = { r'width': width, r'length': length, r'height': height, r'partitionSize': partitionSize, r'randomOffset': randomOffset, r'offsetRange': offsetRange, }; queryParameters.removeWhere((k, v) => v == null); final _headers = {}; final Map? _data = null; final _result = await _dio.fetch>( _setStreamType>>(Options( method: 'GET', headers: _headers, extra: _extra, ) .compose( _dio.options, '/admin-api/zj/kcqydsyt-fsc/flat-sampling-points', queryParameters: queryParameters, data: _data, ) .copyWith( baseUrl: _combineBaseUrls( _dio.options.baseUrl, baseUrl, )))); final value = ApiRsp>.fromJson( _result.data!, (json) => json is List ? json .map( (i) => StockPointsRsp.fromJson(i as Map)) .toList() : List.empty(), ); return value; } @override Future> changeSampleTaskKcjc(Map map) async { const _extra = {}; final queryParameters = {}; final _headers = {}; final _data = {}; _data.addAll(map); final _result = await _dio .fetch>(_setStreamType>(Options( method: 'PUT', headers: _headers, extra: _extra, ) .compose( _dio.options, '/admin-api/zj/code-sampling-task-details-sgjc/appSgjcUpdate', queryParameters: queryParameters, data: _data, ) .copyWith( baseUrl: _combineBaseUrls( _dio.options.baseUrl, baseUrl, )))); final value = ApiRsp.fromJson( _result.data!, (json) => json as bool?, ); return value; } RequestOptions _setStreamType(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(); } }