mirror of
https://github.com/certd/certd.git
synced 2026-05-16 05:07:32 +08:00
perf: 多个dns 提供商支持导入域名
This commit is contained in:
+23
-1
@@ -1,5 +1,6 @@
|
||||
import { AbstractDnsProvider, CreateRecordOptions, IsDnsProvider, RemoveRecordOptions } from '@certd/plugin-cert';
|
||||
import { AbstractDnsProvider, CreateRecordOptions, DomainRecord, IsDnsProvider, RemoveRecordOptions } from '@certd/plugin-cert';
|
||||
import { TencentAccess } from '../../plugin-lib/tencent/index.js';
|
||||
import { Pager, PageRes, PageSearch } from '@certd/pipeline';
|
||||
|
||||
@IsDnsProvider({
|
||||
name: 'tencent',
|
||||
@@ -93,5 +94,26 @@ export class TencentDnsProvider extends AbstractDnsProvider {
|
||||
this.logger.info('删除域名解析成功:', fullRecord, value);
|
||||
return ret;
|
||||
}
|
||||
|
||||
async getDomainListPage(req: PageSearch): Promise<PageRes<DomainRecord>> {
|
||||
|
||||
const pager = new Pager(req);
|
||||
|
||||
const params:any = {
|
||||
Offset: pager.getOffset(),
|
||||
Limit: pager.pageSize,
|
||||
};
|
||||
if (req.searchKey) {
|
||||
params.Keyword = req.searchKey;
|
||||
}
|
||||
const ret = await this.client.DescribeDomainList(params);
|
||||
let list = ret.DomainList || [];
|
||||
list = list.map((item) => ({
|
||||
id: item.DomainId,
|
||||
domain: item.Name,
|
||||
}));
|
||||
const total = ret.DomainCountInfo?.AllTotal || list.length
|
||||
return {total,list,};
|
||||
}
|
||||
}
|
||||
new TencentDnsProvider();
|
||||
|
||||
Reference in New Issue
Block a user