mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 08:48:11 +00:00
26 lines
818 B
TypeScript
26 lines
818 B
TypeScript
import { BaseRepository } from "@edr/api-common";
|
|
import { Injectable } from "@nestjs/common";
|
|
import { InjectRepository } from "@nestjs/typeorm";
|
|
import { Repository } from "typeorm";
|
|
|
|
import { GpsDevice } from "./entities/gps-device.entity";
|
|
import { GpsPosition } from "./entities/gps-position.entity";
|
|
|
|
@Injectable()
|
|
export class GpsDeviceRepository extends BaseRepository<GpsDevice> {
|
|
constructor(@InjectRepository(GpsDevice) repository: Repository<GpsDevice>) {
|
|
super(repository);
|
|
}
|
|
|
|
findByImei(imei: string): Promise<GpsDevice | null> {
|
|
return this.repository.findOne({ where: { imei } });
|
|
}
|
|
}
|
|
|
|
@Injectable()
|
|
export class GpsPositionRepository extends BaseRepository<GpsPosition> {
|
|
constructor(@InjectRepository(GpsPosition) repository: Repository<GpsPosition>) {
|
|
super(repository);
|
|
}
|
|
}
|