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/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/user_rsp.dart'; import 'package:lszlgl/network/base_dio.dart'; import 'package:retrofit/retrofit.dart'; import '../drfit/database.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(); /// 获取所有字典 @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(); /// 扦样任务单更新-收购 @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); }