api.dart 3.7 KB

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