hiển thị thuyền thông tin tàu
This commit is contained in:
@@ -2,7 +2,10 @@ import { api } from "@/config";
|
||||
import {
|
||||
API_GET_ALARMS,
|
||||
API_GET_GPS,
|
||||
API_GET_SHIP_GROUPS,
|
||||
API_GET_SHIP_TYPES,
|
||||
API_PATH_ENTITIES,
|
||||
API_PATH_SEARCH_THINGS,
|
||||
API_PATH_SHIP_TRACK_POINTS,
|
||||
API_SOS,
|
||||
} from "@/constants";
|
||||
@@ -35,3 +38,15 @@ export async function queryDeleteSos() {
|
||||
export async function querySendSosMessage(message: string) {
|
||||
return await api.put<Model.SosRequest>(API_SOS, { message });
|
||||
}
|
||||
|
||||
export async function querySearchThings(body: Model.SearchThingBody) {
|
||||
return await api.post<Model.ThingsResponse>(API_PATH_SEARCH_THINGS, body);
|
||||
}
|
||||
|
||||
export async function queryShipTypes() {
|
||||
return await api.get<Model.ShipType[]>(API_GET_SHIP_TYPES);
|
||||
}
|
||||
|
||||
export async function queryShipGroups() {
|
||||
return await api.get<Model.ShipGroup[]>(API_GET_SHIP_GROUPS);
|
||||
}
|
||||
|
||||
96
controller/typings.d.ts
vendored
96
controller/typings.d.ts
vendored
@@ -15,6 +15,7 @@ declare namespace Model {
|
||||
s: number;
|
||||
h: number;
|
||||
fishing: boolean;
|
||||
t: number;
|
||||
}
|
||||
interface Alarm {
|
||||
name: string;
|
||||
@@ -52,7 +53,7 @@ declare namespace Model {
|
||||
|
||||
// Banzones
|
||||
// Banzone
|
||||
export interface Zone {
|
||||
interface Zone {
|
||||
id?: string;
|
||||
name?: string;
|
||||
type?: number;
|
||||
@@ -62,7 +63,7 @@ declare namespace Model {
|
||||
geom?: Geom;
|
||||
}
|
||||
|
||||
export interface Condition {
|
||||
interface Condition {
|
||||
max?: number;
|
||||
min?: number;
|
||||
type?: Type;
|
||||
@@ -70,12 +71,12 @@ declare namespace Model {
|
||||
from?: number;
|
||||
}
|
||||
|
||||
export enum Type {
|
||||
enum Type {
|
||||
LengthLimit = "length_limit",
|
||||
MonthRange = "month_range",
|
||||
}
|
||||
|
||||
export interface Geom {
|
||||
interface Geom {
|
||||
geom_type?: number;
|
||||
geom_poly?: string;
|
||||
geom_lines?: string;
|
||||
@@ -211,4 +212,91 @@ declare namespace Model {
|
||||
cites_appendix: any;
|
||||
vn_law: boolean;
|
||||
}
|
||||
|
||||
// Seagateway Owner Appp
|
||||
interface SearchThingBody {
|
||||
offset?: number;
|
||||
limit?: number;
|
||||
order?: string;
|
||||
sort?: "asc" | "desc";
|
||||
name?: string;
|
||||
metadata?: any;
|
||||
}
|
||||
|
||||
interface ThingsResponse {
|
||||
total?: number;
|
||||
offset?: number;
|
||||
limit?: number;
|
||||
order?: string;
|
||||
direction?: string;
|
||||
metadata?: ThingsResponseMetadata;
|
||||
things?: Thing[];
|
||||
}
|
||||
|
||||
interface ThingsResponseMetadata {
|
||||
total_connected?: number;
|
||||
total_filter?: number;
|
||||
total_sos?: number;
|
||||
total_state_level_0?: number;
|
||||
total_state_level_1?: number;
|
||||
total_state_level_2?: number;
|
||||
total_thing?: number;
|
||||
}
|
||||
|
||||
interface Thing {
|
||||
id?: string;
|
||||
name?: string;
|
||||
key?: string;
|
||||
metadata?: ThingMetadata;
|
||||
}
|
||||
|
||||
interface ThingMetadata {
|
||||
address?: string;
|
||||
alarm_list?: string;
|
||||
basename?: string;
|
||||
cfg_channel_id?: string;
|
||||
cfg_id?: string;
|
||||
connected?: boolean;
|
||||
ctrl_channel_id?: string;
|
||||
data_channel_id?: string;
|
||||
enduser?: string;
|
||||
external_id?: string;
|
||||
gps?: string;
|
||||
gps_time?: string;
|
||||
group_id?: string;
|
||||
req_channel_id?: string;
|
||||
ship_group_id?: string;
|
||||
ship_id?: string;
|
||||
ship_length?: string;
|
||||
ship_name?: string;
|
||||
ship_power?: string;
|
||||
ship_reg_number?: string;
|
||||
ship_type?: string;
|
||||
sos?: string;
|
||||
sos_time?: string;
|
||||
state?: string;
|
||||
state_level?: number;
|
||||
state_updated_time?: number;
|
||||
trip_state?: string;
|
||||
type?: string;
|
||||
updated_time?: number;
|
||||
uptime?: number;
|
||||
zone_approaching_alarm_list?: string;
|
||||
zone_entered_alarm_list?: string;
|
||||
zone_fishing_alarm_list?: string;
|
||||
}
|
||||
|
||||
// Ship
|
||||
interface ShipType {
|
||||
id?: number;
|
||||
name?: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
interface ShipGroup {
|
||||
id?: string;
|
||||
name?: string;
|
||||
owner_id?: string;
|
||||
description?: string;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user