thêm giao diện map và cập nhật nativewind
This commit is contained in:
@@ -1,6 +1,18 @@
|
||||
import { api } from "@/config";
|
||||
import { API_GET_GPS } from "@/constants";
|
||||
import {
|
||||
API_GET_ALARMS,
|
||||
API_GET_GPS,
|
||||
API_PATH_SHIP_TRACK_POINTS,
|
||||
} from "@/constants";
|
||||
|
||||
export async function fetchGpsData() {
|
||||
export async function queryGpsData() {
|
||||
return api.get<Model.GPSResonse>(API_GET_GPS);
|
||||
}
|
||||
|
||||
export async function queryAlarm() {
|
||||
return api.get<Model.AlarmResponse>(API_GET_ALARMS);
|
||||
}
|
||||
|
||||
export async function queryTrackPoints() {
|
||||
return api.get<Model.ShipTrackPoint[]>(API_PATH_SHIP_TRACK_POINTS);
|
||||
}
|
||||
|
||||
19
controller/typings.d.ts
vendored
19
controller/typings.d.ts
vendored
@@ -14,4 +14,23 @@ declare namespace Model {
|
||||
h: number;
|
||||
fishing: boolean;
|
||||
}
|
||||
interface Alarm {
|
||||
name: string;
|
||||
t: number; // timestamp (epoch seconds)
|
||||
level: number;
|
||||
id: string;
|
||||
}
|
||||
|
||||
interface AlarmResponse {
|
||||
alarms: Alarm[];
|
||||
level: number;
|
||||
}
|
||||
|
||||
interface ShipTrackPoint {
|
||||
time: number;
|
||||
lon: number;
|
||||
lat: number;
|
||||
s: number;
|
||||
h: number;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user