Files
certd/packages/ui/certd-server/src/controller/pipeline/dns-provider-controller.ts
T

35 lines
959 B
TypeScript
Raw Normal View History

2024-07-15 00:30:33 +08:00
import { ALL, Controller, Inject, Post, Provide, Query } from '@midwayjs/core';
import { DnsProviderService } from '../../modules/pipeline/service/dns-provider-service.js';
2024-10-03 22:03:49 +08:00
import { BaseController } from '@certd/lib-server';
import { Constants } from '@certd/lib-server';
2023-01-29 13:44:19 +08:00
/**
* 插件
*/
@Provide()
@Controller('/api/pi/dnsProvider')
export class DnsProviderController extends BaseController {
@Inject()
service: DnsProviderService;
2023-06-27 09:29:43 +08:00
@Post('/list', { summary: Constants.per.authOnly })
2024-09-29 14:57:20 +08:00
async list(@Query(ALL) query: any) {
2024-10-10 02:15:05 +08:00
query.userId = this.getUserId();
2023-01-29 13:44:19 +08:00
const list = this.service.getList();
return this.ok(list);
}
2023-06-27 09:29:43 +08:00
@Post('/dnsProviderTypeDict', { summary: Constants.per.authOnly })
2023-01-29 13:44:19 +08:00
async getDnsProviderTypeDict() {
const list = this.service.getList();
const dict = [];
for (const item of list) {
dict.push({
value: item.name,
label: item.title,
});
}
return this.ok(dict);
}
}