mirror of
https://github.com/certd/certd.git
synced 2026-05-17 13:57:31 +08:00
15 lines
488 B
TypeScript
15 lines
488 B
TypeScript
import { CnameRecord, ICnameProxyService } from '@certd/pipeline';
|
|
|
|
export class CnameProxyService implements ICnameProxyService {
|
|
userId: number;
|
|
getter: <T>(domain: string, userId?: number) => Promise<T>;
|
|
constructor(userId: number, getter: (domain: string, userId: number) => Promise<any>) {
|
|
this.userId = userId;
|
|
this.getter = getter;
|
|
}
|
|
|
|
async getByDomain(domain: string): Promise<CnameRecord> {
|
|
return await this.getter<CnameRecord>(domain, this.userId);
|
|
}
|
|
}
|