Checkpoint
This commit is contained in:
40
ui/src/services/APRSService.ts
Normal file
40
ui/src/services/APRSService.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import type { APIService } from './API';
|
||||
|
||||
export interface FetchedAPRSPacket {
|
||||
id?: number;
|
||||
radio_id?: number;
|
||||
radio?: {
|
||||
id?: number;
|
||||
name?: string;
|
||||
};
|
||||
src?: string;
|
||||
source?: string;
|
||||
dst?: string;
|
||||
destination?: string;
|
||||
path?: string;
|
||||
comment?: string;
|
||||
latitude?: number | { Float64?: number; Valid?: boolean } | null;
|
||||
longitude?: number | { Float64?: number; Valid?: boolean } | null;
|
||||
raw?: string;
|
||||
payload?: string;
|
||||
received_at?: string;
|
||||
timestamp?: string;
|
||||
time?: string;
|
||||
created_at?: string;
|
||||
}
|
||||
|
||||
export class APRSServiceImpl {
|
||||
private api: APIService;
|
||||
|
||||
constructor(api: APIService) {
|
||||
this.api = api;
|
||||
}
|
||||
|
||||
public async fetchPackets(limit = 200): Promise<FetchedAPRSPacket[]> {
|
||||
const endpoint = '/aprs/packets';
|
||||
const params = { limit };
|
||||
return this.api.fetch<FetchedAPRSPacket[]>(endpoint, { params });
|
||||
}
|
||||
}
|
||||
|
||||
export default APRSServiceImpl;
|
||||
Reference in New Issue
Block a user