mirror of
https://github.com/certd/certd.git
synced 2026-05-16 21:27:34 +08:00
perf: 所有的dnsprovider 支持导入域名列表
This commit is contained in:
@@ -68,7 +68,7 @@ export class GodaddyAccess extends BaseAccess {
|
||||
|
||||
const pager = new Pager(opts);
|
||||
const req = {
|
||||
url :`/v1/domains?limit=${pager.pageSize}`,
|
||||
url :`/v1/domains?limit=${pager.pageSize}&offset=${pager.getOffset()}`,
|
||||
method: "get",
|
||||
}
|
||||
return await this.doRequest(req);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions } from "@certd/plugin-cert";
|
||||
import { AbstractDnsProvider, CreateRecordOptions, DomainRecord, IsDnsProvider, RemoveRecordOptions } from "@certd/plugin-cert";
|
||||
|
||||
import { GodaddyAccess } from "./access.js";
|
||||
import { Pager, PageRes, PageSearch } from "@certd/pipeline";
|
||||
|
||||
export type GodaddyRecord = {
|
||||
domain: string,
|
||||
@@ -84,6 +85,23 @@ export class GodaddyDnsProvider extends AbstractDnsProvider<GodaddyRecord> {
|
||||
})
|
||||
this.logger.info(`删除域名解析成功:fullRecord=${fullRecord},id=${res}`);
|
||||
}
|
||||
|
||||
async getDomainListPage(req: PageSearch): Promise<PageRes<DomainRecord>> {
|
||||
const pager = new Pager(req);
|
||||
|
||||
const ret = await this.access.getDomainList(req)
|
||||
|
||||
let list = ret.zones || []
|
||||
list = list.map((item: any) => ({
|
||||
id: item.domainId,
|
||||
domain: item.domain,
|
||||
}));
|
||||
const total = list.length === pager.pageSize ? list.length+1: list.length
|
||||
return {
|
||||
total,
|
||||
list,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
//实例化这个provider,将其自动注册到系统中
|
||||
|
||||
Reference in New Issue
Block a user