api.dart 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. import 'dart:io';
  2. import 'package:dio/dio.dart';
  3. import 'package:lszlgl/model/api_rsp.dart';
  4. import 'package:lszlgl/model/req/login_req.dart';
  5. import 'package:lszlgl/model/rsp/dict_rsp.dart';
  6. import 'package:lszlgl/model/rsp/login_rsp.dart';
  7. import 'package:lszlgl/model/rsp/sample_task_rsp.dart';
  8. import 'package:lszlgl/model/rsp/user_rsp.dart';
  9. import 'package:lszlgl/network/base_dio.dart';
  10. import 'package:retrofit/retrofit.dart';
  11. import '../model/req/device_req.dart';
  12. import '../model/rsp/district_rsp.dart';
  13. part 'api.g.dart';
  14. @RestApi()
  15. abstract class Api {
  16. factory Api({Dio? dio, String? baseUrl}) {
  17. dio ??= BaseDio.get().dio;
  18. return _Api(dio, baseUrl: baseUrl);
  19. }
  20. /// 登录
  21. @POST('/admin-api/system/auth/login')
  22. Future<ApiRsp<LoginRsp>> login(@Body() LoginReq req);
  23. /// 个人信息
  24. @GET('/admin-api/system/user/profile/get')
  25. Future<ApiRsp<UserRsp>> userProfile();
  26. /// 修改用户个人密码
  27. /// * [oldPassword] 旧密码
  28. /// * [newPassword] 新密码
  29. @PUT('/admin-api/system/user/profile/update-password')
  30. Future<ApiRsp<bool>> updatePassword(@Body() Map<String, dynamic> map);
  31. /// 获取所有字典
  32. @GET('/admin-api/system/dict-data/simple-list')
  33. Future<ApiRsp<List<DictRsp>>> getAllDict();
  34. /// 扦样任务单列表
  35. @GET('/admin-api/zj/code-sampling-task-details-sgjc/sampling_task_detail_page')
  36. Future<ApiRsp<SampleTaskListRsp>> sampleTaskList(@Queries() Map<String, dynamic> map);
  37. /// 获取app下载地址
  38. @GET('/admin-api/zj/base-file/getAppDownLoadUrl')
  39. Future<ApiRsp<String?>> getAppDownloadUrl();
  40. /// 扦样任务单更新-收购
  41. @PUT('/admin-api/zj/code-sampling-task-details-sgjc/update')
  42. Future<ApiRsp<bool?>> updateSampleTaskSgjc(@Body() Map<String, dynamic> map);
  43. /// 扦样任务单更新-库存
  44. @PUT('/admin-api/zj/code-sampling-task-details-kcjc/update')
  45. Future<ApiRsp<bool?>> updateSampleTaskKcjc(@Body() Map<String, dynamic> map);
  46. /// 扦样任务单详情-收购
  47. @GET('/admin-api/zj/code-sampling-task-details-sgjc/getSamplingTaskDetails')
  48. Future<ApiRsp<SampleTaskItem?>> sampleTaskDetailSgjc(@Query('id') num id);
  49. /// 扦样任务单详情-库存
  50. @GET('/admin-api/zj/code-sampling-task-details-kcjc/get')
  51. Future<ApiRsp<SampleTaskItemKcjcRsp?>> sampleTaskDetailKcjc(@Query('id') num id);
  52. /// 土壤信息列表
  53. @GET('/admin-api/zj/base-soil-information/trxxxz')
  54. Future<ApiRsp<List<TrxxRsp>?>> trxxList();
  55. /// 粮食信息列表
  56. @GET('/admin-api/zj/base-grain-information/lsxxfl')
  57. Future<ApiRsp<List<LsxxRsp>?>> lsxxList(@Query('zlmc') String zlmc);
  58. /// 领取扦样任务单-收购
  59. @GET('/admin-api/zj/code-sampling-task-details-sgjc/updateStatus')
  60. Future<ApiRsp<num?>> receiveSampleTaskSgjc(@Query('id') num id);
  61. /// 获得扦样机构对应的人员信息
  62. @GET('/admin-api/zj/base-personnel/selectByJhcyjg')
  63. Future<ApiRsp<List<PersonRsp>?>> getPersonMenu(@Query('jhcyjg') num jhcyjg);
  64. /// 省市县
  65. @GET('/admin-api/zj/base-administrative-division/list')
  66. Future<ApiRsp<List<DistrictRsp>?>> districtList(
  67. @Query('uLevel') num uLevel, {
  68. @Query('id') num? id,
  69. });
  70. /// 上传图片
  71. @POST('/admin-api/infra/file/upload')
  72. Future<ApiRsp<String?>> upload(@Part(name: 'file') File file);
  73. /// 提交设备绑定信息
  74. @POST('/admin-api/zj/base-device/createBatch')
  75. Future<ApiRsp> postDeviceInfos(@Body() List<DeviceReq> req);
  76. }