123456789101112131415161718192021222324252627282930313233343536373839 |
- import 'package:dio/dio.dart';
- import 'package:flutter_tracker/dio/api.dart';
- import 'package:flutter_tracker/model/submit_model.dart';
- /// Description:
- /// Time : 2021年12月03日 Friday
- /// Author : liuyuqi.gov@msncn
- class TrackDao {
- static Map<String, dynamic> params = <String, dynamic>{};
- static Future<SubmitModel> uploadImg(
- String token, String filePath, String fileName) async {
- params.addAll({"token": token, "filePath": filePath, "fileName": fileName});
- await Dio()
- .post(Api.uploadImgUrl, queryParameters: params)
- .then((response) {
- return SubmitModel.fromJson(response.data);
- });
- return SubmitModel.fromJson({"success": false, "msg": "网络错误"});
- }
- static Future<SubmitModel> uploadTrack(
- String token, String telphone, String address, bool health) async {
- params.addAll({
- "token": token,
- "telphone": telphone,
- "address": address,
- "health": health
- });
- await Dio()
- .post(Api.uploadTrackUrl, queryParameters: params)
- .then((response) {
- return SubmitModel.fromJson(response.data);
- });
- return SubmitModel.fromJson({"success": false, "msg": "网络错误"});
- }
- }
|