EUS/services/DomainService.ts

31 lines
No EOL
729 B
TypeScript

import { Console } from "hsconsole";
import DomainRepo from "../repos/DomainRepo";
export default abstract class DomainService {
public static async LoadDomains() {
try {
return await DomainRepo.SelectAll();
} catch (e) {
Console.printError(`EUS server service error:\n${e}`);
throw e;
}
}
public static async LoadDomainByHost(host: string) {
try {
return await DomainRepo.SelectByDomain(host);
} catch (e) {
Console.printError(`EUS server service error:\n${e}`);
throw e;
}
}
public static async LoadDomainByMediaHost(host: string) {
try {
return await DomainRepo.SelectByMediaDomain(host);
} catch (e) {
Console.printError(`EUS server service error:\n${e}`);
throw e;
}
}
}