123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- 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 '../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<ApiRsp<LoginRsp>> login(@Body() LoginReq req);
- /// 个人信息
- @GET('/admin-api/system/user/profile/get')
- Future<ApiRsp<UserRsp>> userProfile();
- /// 修改用户个人密码
- /// * [oldPassword] 旧密码
- /// * [newPassword] 新密码
- @PUT('/admin-api/system/user/profile/update-password')
- Future<ApiRsp<bool>> updatePassword(@Body() Map<String, dynamic> map);
- /// 获取所有字典
- @GET('/admin-api/system/dict-data/simple-list')
- Future<ApiRsp<List<DictRsp>>> getAllDict();
- /// 扦样任务单列表
- @GET('/admin-api/zj/code-sampling-task-details-sgjc/sampling_task_detail_page')
- Future<ApiRsp<SampleTaskListRsp>> sampleTaskList(@Queries() Map<String, dynamic> map);
- /// 获取app下载地址
- @GET('/admin-api/zj/base-file/getAppDownLoadUrl')
- Future<ApiRsp<String?>> getAppDownloadUrl();
- /// 扦样任务单更新-收购
- @PUT('/admin-api/zj/code-sampling-task-details-sgjc/update')
- Future<ApiRsp<bool?>> updateSampleTaskSgjc(@Body() Map<String, dynamic> map);
- /// 扦样任务单更新-库存
- @PUT('/admin-api/zj/code-sampling-task-details-kcjc/update')
- Future<ApiRsp<bool?>> updateSampleTaskKcjc(@Body() Map<String, dynamic> map);
- /// 扦样任务单详情-收购
- @GET('/admin-api/zj/code-sampling-task-details-sgjc/getSamplingTaskDetails')
- Future<ApiRsp<SampleTaskItem?>> sampleTaskDetailSgjc(@Query('id') num id);
- /// 扦样任务单详情-库存
- @GET('/admin-api/zj/code-sampling-task-details-kcjc/get')
- Future<ApiRsp<SampleTaskItemKcjcRsp?>> sampleTaskDetailKcjc(@Query('id') num id);
- /// 土壤信息列表
- @GET('/admin-api/zj/base-soil-information/trxxxz')
- Future<ApiRsp<List<TrxxRsp>?>> trxxList();
- /// 粮食信息列表
- @GET('/admin-api/zj/base-grain-information/lsxxfl')
- Future<ApiRsp<List<LsxxRsp>?>> lsxxList(@Query('zlmc') String zlmc);
- /// 领取扦样任务单-收购
- @GET('/admin-api/zj/code-sampling-task-details-sgjc/updateStatus')
- Future<ApiRsp<num?>> receiveSampleTaskSgjc(@Query('id') num id);
- /// 获得扦样机构对应的人员信息
- @GET('/admin-api/zj/base-personnel/selectByJhcyjg')
- Future<ApiRsp<List<PersonRsp>?>> getPersonMenu(@Query('jhcyjg') num jhcyjg);
- /// 省市县
- @GET('/admin-api/zj/base-administrative-division/list')
- Future<ApiRsp<List<DistrictRsp>?>> districtList(
- @Query('uLevel') num uLevel, {
- @Query('id') num? id,
- });
- /// 上传图片
- @POST('/admin-api/infra/file/upload')
- Future<ApiRsp<String?>> upload(@Part(name: 'file') File file);
- /// 提交设备绑定信息
- @POST('/admin-api/zj/base-device/createBatch')
- Future<ApiRsp> postDeviceInfos(@Body() List<DeviceReq> req);
- }
|