api.dart 3.9 KB

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