feat: initial setup backend with default routes and db connection
This commit is contained in:
30
server/src/services/wifiScanService.ts
Normal file
30
server/src/services/wifiScanService.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import { inject, injectable } from "tsyringe";
|
||||
import { WifiScan } from "../models/wifiScan";
|
||||
import { WifiScanRepository } from "../repositories/wifiScanRepository";
|
||||
|
||||
@injectable()
|
||||
export class WifiScanService {
|
||||
constructor(
|
||||
@inject(WifiScanRepository) private repository: WifiScanRepository
|
||||
) {}
|
||||
|
||||
public async getAllWifiScans() {
|
||||
return this.repository.findAll();
|
||||
}
|
||||
|
||||
public async getWifiScanById(id: string) {
|
||||
return this.repository.findById(id);
|
||||
}
|
||||
|
||||
public async createWifiScan(data: Partial<WifiScan>) {
|
||||
return this.repository.create(data);
|
||||
}
|
||||
|
||||
public async updateWifiScan(id: string, data: Partial<WifiScan>) {
|
||||
return this.repository.update(id, data);
|
||||
}
|
||||
|
||||
public async deleteWifiScan(id: string) {
|
||||
return this.repository.delete(id);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user