mirror of
https://github.com/certd/certd.git
synced 2026-04-23 19:57:27 +08:00
perf: 多个dns 提供商支持导入域名
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions } from "@certd/plugin-cert";
|
||||
import { AbstractDnsProvider, CreateRecordOptions, DomainRecord, IsDnsProvider, RemoveRecordOptions } from "@certd/plugin-cert";
|
||||
import { XinnetAgentAccess } from "./access-agent.js";
|
||||
import { PageRes, PageSearch } from "@certd/pipeline";
|
||||
|
||||
export type XinnetAgentRecord = {
|
||||
recordId: number;
|
||||
@@ -81,9 +82,20 @@ line 是 string 线路 只能传"默认"
|
||||
domainName: domainName
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
async getDomainListPage(req: PageSearch): Promise<PageRes<DomainRecord>> {
|
||||
const res = await this.access.getDomainList(req);
|
||||
const list = res.list.map((item) => ({
|
||||
domain: item.domainName,
|
||||
id: item.domainName
|
||||
}));
|
||||
return {
|
||||
list: list || [],
|
||||
total: res.totalRows || 0
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//实例化这个provider,将其自动注册到系统中
|
||||
|
||||
@@ -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