12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- import 'dart:io';
- import 'package:dio/dio.dart';
- import 'package:lszlgl/model/api_rsp.dart';
- import 'package:lszlgl/model/req/login_req.dart';
- import 'package:lszlgl/model/rsp/dict_rsp.dart';
- import 'package:lszlgl/model/rsp/login_rsp.dart';
- import 'package:lszlgl/model/rsp/sample_task_rsp.dart';
- import 'package:lszlgl/model/rsp/user_rsp.dart';
- import 'package:lszlgl/network/base_dio.dart';
- import 'package:retrofit/retrofit.dart';
- import '../drfit/database.dart';
- import '../model/req/device_req.dart';
- import '../model/rsp/district_rsp.dart';
- part 'api.g.dart';
- @RestApi()
- abstract class Api {
- factory Api({Dio? dio, String? baseUrl}) {
- dio ??= BaseDio.get().dio;
- return _Api(dio, baseUrl: baseUrl);
- }
- /// 登录
- @POST('/admin-api/system/auth/login')
- Future<ApiRsp<LoginRsp>> login(@Body() LoginReq req);
- /// 个人信息
- @GET('/admin-api/system/user/profile/get')
- Future<ApiRsp<UserRsp>> userProfile();
- /// 获取所有字典
- @GET('/admin-api/system/dict-data/simple-list')
- Future<ApiRsp<List<DictRsp>>> getAllDict();
- /// 扦样任务单列表
- @GET('/admin-api/zj/code-sampling-task-details-sgjc/sampling_task_detail_page')
- Future<ApiRsp<SampleTaskListRsp>> sampleTaskList(@Queries() Map<String, dynamic> map);
- /// 获取app下载地址
- @GET('/admin-api/zj/base-file/getAppDownLoadUrl')
- Future<ApiRsp<String?>> getAppDownloadUrl();
- /// 扦样任务单更新-收购
- @PUT('/admin-api/zj/code-sampling-task-details-sgjc/update')
- Future<ApiRsp<bool?>> updateSampleTaskSgjc(@Body() Map<String, dynamic> map);
- /// 扦样任务单更新-库存
- @PUT('/admin-api/zj/code-sampling-task-details-kcjc/update')
- Future<ApiRsp<bool?>> updateSampleTaskKcjc(@Body() Map<String, dynamic> map);
- /// 扦样任务单详情-收购
- @GET('/admin-api/zj/code-sampling-task-details-sgjc/getSamplingTaskDetails')
- Future<ApiRsp<SampleTaskItem?>> sampleTaskDetailSgjc(@Query('id') num id);
- /// 扦样任务单详情-库存
- @GET('/admin-api/zj/code-sampling-task-details-kcjc/get')
- Future<ApiRsp<SampleTaskItemKcjcRsp?>> sampleTaskDetailKcjc(@Query('id') num id);
- /// 土壤信息列表
- @GET('/admin-api/zj/base-soil-information/trxxxz')
- Future<ApiRsp<List<TrxxRsp>?>> trxxList();
- /// 粮食信息列表
- @GET('/admin-api/zj/base-grain-information/lsxxfl')
- Future<ApiRsp<List<LsxxRsp>?>> lsxxList(@Query('zlmc') String zlmc);
- /// 领取扦样任务单-收购
- @GET('/admin-api/zj/code-sampling-task-details-sgjc/updateStatus')
- Future<ApiRsp<num?>> receiveSampleTaskSgjc(@Query('id') num id);
- /// 获得扦样机构对应的人员信息
- @GET('/admin-api/zj/base-personnel/selectByJhcyjg')
- Future<ApiRsp<List<PersonRsp>?>> getPersonMenu(@Query('jhcyjg') num jhcyjg);
- /// 省市县
- @GET('/admin-api/zj/base-administrative-division/list')
- Future<ApiRsp<List<DistrictRsp>?>> districtList(
- @Query('uLevel') num uLevel, {
- @Query('id') num? id,
- });
- /// 上传图片
- @POST('/admin-api/infra/file/upload')
- Future<ApiRsp<String?>> upload(@Part(name: 'file') File file);
- /// 提交设备绑定信息
- @POST('/admin-api/zj/base-device/createBatch')
- Future<ApiRsp> postDeviceInfos(@Body() List<DeviceReq> req);
- }
|