mirror of
https://github.com/certd/certd.git
synced 2026-05-16 21:27:34 +08:00
perf: 多个dns 提供商支持导入域名
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions } from "@certd/plugin-cert";
|
||||
import { AbstractDnsProvider, CreateRecordOptions, DomainRecord, IsDnsProvider, RemoveRecordOptions } from "@certd/plugin-cert";
|
||||
import { XinnetAccess } from "./access.js";
|
||||
import { XinnetClient } from "@certd/plugin-plus";
|
||||
import { PageRes, PageSearch } from "@certd/pipeline";
|
||||
|
||||
export type XinnetRecord = {
|
||||
recordId: number;
|
||||
@@ -104,6 +105,26 @@ export class XinnetProvider extends AbstractDnsProvider<XinnetRecord> {
|
||||
|
||||
|
||||
}
|
||||
|
||||
async getDomainListPage(req: PageSearch): Promise<PageRes<DomainRecord>> {
|
||||
|
||||
const client = new XinnetClient({
|
||||
logger: this.logger,
|
||||
access: this.access,
|
||||
http: this.http
|
||||
});
|
||||
|
||||
const res = await client.getDomainList(req);
|
||||
|
||||
const list = res.list.map((item) => ({
|
||||
domain: item.domainName,
|
||||
id: item.domainName
|
||||
}));
|
||||
return {
|
||||
list: list || [],
|
||||
total: res.totalRows || 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//实例化这个provider,将其自动注册到系统中
|
||||
|
||||
Reference in New Issue
Block a user