import 'dart:io'; import 'package:dio/dio.dart'; import 'package:lszlgl/model/api_rsp.dart'; import 'package:lszlgl/model/req/login_req.dart'; import 'package:lszlgl/model/rsp/deviation_loaction_rsp.dart'; import 'package:lszlgl/model/rsp/dict_rsp.dart'; import 'package:lszlgl/model/rsp/login_rsp.dart'; import 'package:lszlgl/model/rsp/sample_task_rsp.dart'; import 'package:lszlgl/model/rsp/stock_points_rsp.dart'; import 'package:lszlgl/model/rsp/storehouse_rsp.dart'; import 'package:lszlgl/model/rsp/user_rsp.dart'; import 'package:lszlgl/network/base_dio.dart'; import 'package:retrofit/http.dart'; import 'package:retrofit/retrofit.dart'; import '../model/req/device_req.dart'; import '../model/rsp/district_rsp.dart'; part 'api.g.dart'; @RestApi() abstract class Api { factory Api({Dio? dio, String? baseUrl}) { dio ??= BaseDio.get().dio; return _Api(dio, baseUrl: baseUrl); } /// 登录 @POST('/admin-api/system/auth/login') Future> login(@Body() LoginReq req); /// 个人信息 @GET('/admin-api/system/user/profile/get') Future> userProfile(); /// 修改用户个人密码 /// * [oldPassword] 旧密码 /// * [newPassword] 新密码 @PUT('/admin-api/system/user/profile/update-password') Future> updatePassword(@Body() Map map); /// 获取仓库详细信息 @GET('/admin-api/coding/fmxx/queryLsxxList') Future>> getStoreMessage(@Query('ajbm') String ajbm,@Query('key') String key); /// 获取所有字典 @GET('/admin-api/system/dict-data/simple-list') Future>> getAllDict(); /// 扦样任务单列表 @GET('/admin-api/zj/code-sampling-task-details-sgjc/sampling_task_detail_page') Future> sampleTaskList(@Queries() Map map); /// 获取app下载地址 @GET('/admin-api/zj/base-file/getAppDownLoadUrl') Future> getAppDownloadUrl(); /// 获取app下载地址 和 更新内容 @GET('/admin-api/zj/base-file/getAppDownLoadUrlAndName') Future> getAppDownLoadUrlAndName(); /// 扦样任务单更新-收购 @PUT('/admin-api/zj/code-sampling-task-details-sgjc/update') Future> updateSampleTaskSgjc(@Body() Map map); /// 扦样任务单更新-库存 @PUT('/admin-api/zj/code-sampling-task-details-kcjc/update') Future> updateSampleTaskKcjc(@Body() Map map); /// 扦样任务单详情-收购 @GET('/admin-api/zj/code-sampling-task-details-sgjc/getSamplingTaskDetails') Future> sampleTaskDetailSgjc(@Query('id') num id); /// 扦样任务单详情-库存 @GET('/admin-api/zj/code-sampling-task-details-kcjc/get') Future> sampleTaskDetailKcjc(@Query('id') num id); /// 土壤信息列表 @GET('/admin-api/zj/base-soil-information/trxxxz') Future?>> trxxList(); /// 粮食信息列表 @GET('/admin-api/zj/base-grain-information/lsxxfl') Future?>> lsxxList(@Query('zlmc') String zlmc); /// 领取扦样任务单-收购 @GET('/admin-api/zj/code-sampling-task-details-sgjc/updateStatus') Future> receiveSampleTaskSgjc(@Query('id') num id); /// 获得扦样机构对应的人员信息 @GET('/admin-api/zj/base-personnel/selectByJhcyjg') Future?>> getPersonMenu(@Query('jhcyjg') num jhcyjg); /// 省市县 @GET('/admin-api/zj/base-administrative-division/list') Future?>> districtList( @Query('uLevel') num uLevel, { @Query('id') num? id, }); /// 上传图片 @POST('/admin-api/infra/file/upload') Future> upload(@Part(name: 'file') File file); /// 提交设备绑定信息 @POST('/admin-api/zj/base-device/createBatch') Future postDeviceInfos(@Body() List req); /// 获取手机验证码 @POST('/admin-api/system/auth/reset_password_send_sms_code') Future> postPhoneMsg(@Body() Map map); /// 登录时手机验证码获取 @POST('/admin-api/system/auth/send-sms-code') Future> loginWithPhoneMsg(@Body() Map map); /// 手机验证码验证登录 @POST('/admin-api/system/auth/sms-login') Future> smsLogin(@Body() Map map); ///忘记密码 @POST('/admin-api/system/auth/reset_password') Future> resetPassword(@Body() Map map); /// 库存取样点 @GET('/admin-api/zj/kcqydsyt-fsc/flat-sampling-points') Future?>> stockPoints({ @Query('width') double? width, @Query('length') double? length, @Query('height') double? height, @Query('partitionSize') double? partitionSize, @Query('randomOffset') bool? randomOffset, @Query('offsetRange') double? offsetRange, }); /// 已扦样信息修改 @PUT('/admin-api/zj/code-sampling-task-details-sgjc/appSgjcUpdate') Future> changeSampleTaskKcjc(@Body() Map map); }