api.dart 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 '../drfit/database.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. @GET('/admin-api/system/dict-data/simple-list')
  29. Future<ApiRsp<List<DictRsp>>> getAllDict();
  30. /// 扦样任务单列表
  31. @GET('/admin-api/zj/code-sampling-task-details-sgjc/sampling_task_detail_page')
  32. Future<ApiRsp<SampleTaskListRsp>> sampleTaskList(@Queries() Map<String, dynamic> map);
  33. /// 获取app下载地址
  34. @GET('/admin-api/zj/base-file/getAppDownLoadUrl')
  35. Future<ApiRsp<String?>> getAppDownloadUrl();
  36. /// 扦样任务单更新-收购
  37. @PUT('/admin-api/zj/code-sampling-task-details-sgjc/update')
  38. Future<ApiRsp<bool?>> updateSampleTaskSgjc(@Body() Map<String, dynamic> map);
  39. /// 扦样任务单更新-库存
  40. @PUT('/admin-api/zj/code-sampling-task-details-kcjc/update')
  41. Future<ApiRsp<bool?>> updateSampleTaskKcjc(@Body() Map<String, dynamic> map);
  42. /// 扦样任务单详情-收购
  43. @GET('/admin-api/zj/code-sampling-task-details-sgjc/getSamplingTaskDetails')
  44. Future<ApiRsp<SampleTaskItem?>> sampleTaskDetailSgjc(@Query('id') num id);
  45. /// 扦样任务单详情-库存
  46. @GET('/admin-api/zj/code-sampling-task-details-kcjc/get')
  47. Future<ApiRsp<SampleTaskItemKcjcRsp?>> sampleTaskDetailKcjc(@Query('id') num id);
  48. /// 土壤信息列表
  49. @GET('/admin-api/zj/base-soil-information/trxxxz')
  50. Future<ApiRsp<List<TrxxRsp>?>> trxxList();
  51. /// 粮食信息列表
  52. @GET('/admin-api/zj/base-grain-information/lsxxfl')
  53. Future<ApiRsp<List<LsxxRsp>?>> lsxxList(@Query('zlmc') String zlmc);
  54. /// 领取扦样任务单-收购
  55. @GET('/admin-api/zj/code-sampling-task-details-sgjc/updateStatus')
  56. Future<ApiRsp<num?>> receiveSampleTaskSgjc(@Query('id') num id);
  57. /// 获得扦样机构对应的人员信息
  58. @GET('/admin-api/zj/base-personnel/selectByJhcyjg')
  59. Future<ApiRsp<List<PersonRsp>?>> getPersonMenu(@Query('jhcyjg') num jhcyjg);
  60. /// 省市县
  61. @GET('/admin-api/zj/base-administrative-division/list')
  62. Future<ApiRsp<List<DistrictRsp>?>> districtList(
  63. @Query('uLevel') num uLevel, {
  64. @Query('id') num? id,
  65. });
  66. /// 上传图片
  67. @POST('/admin-api/infra/file/upload')
  68. Future<ApiRsp<String?>> upload(@Part(name: 'file') File file);
  69. /// 提交设备绑定信息
  70. @POST('/admin-api/zj/base-device/createBatch')
  71. Future<ApiRsp> postDeviceInfos(@Body() List<DeviceReq> req);
  72. }