25 lines
658 B
Dart
25 lines
658 B
Dart
|
|
import 'dart:convert';
|
||
|
|
|
||
|
|
import 'package:dio/dio.dart';
|
||
|
|
|
||
|
|
import 'baseDio.dart';
|
||
|
|
|
||
|
|
import 'package:logger/logger.dart';
|
||
|
|
|
||
|
|
class MonitorApi {
|
||
|
|
static var logger = Logger(
|
||
|
|
printer: PrettyPrinter(),
|
||
|
|
);
|
||
|
|
|
||
|
|
static Future<dynamic> countAvailable({int timeOut = 5000}) async {
|
||
|
|
final response =
|
||
|
|
await BaseDio.instance().get<String>("/app/location/count",
|
||
|
|
options: Options(
|
||
|
|
responseType: ResponseType.json,
|
||
|
|
sendTimeout: Duration(milliseconds: timeOut),
|
||
|
|
receiveTimeout: Duration(milliseconds: timeOut),
|
||
|
|
));
|
||
|
|
logger.e("yuqili $response");
|
||
|
|
return {"code": response.statusCode, "data": response.data};
|
||
|
|
}
|
||
|
|
}
|