api.dart 5.1 KB

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