mirror of
https://github.com/certd/certd.git
synced 2026-05-16 13:17:29 +08:00
build: trident-sync prepare
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
import {
|
||||
ALL,
|
||||
Controller,
|
||||
Inject,
|
||||
Post,
|
||||
Provide,
|
||||
Query,
|
||||
} from '@midwayjs/decorator';
|
||||
import { DnsProviderService } from '../service/dns-provider-service';
|
||||
import { BaseController } from '../../../basic/base-controller';
|
||||
|
||||
/**
|
||||
* 插件
|
||||
*/
|
||||
@Provide()
|
||||
@Controller('/api/pi/dnsProvider')
|
||||
export class DnsProviderController extends BaseController {
|
||||
@Inject()
|
||||
service: DnsProviderService;
|
||||
|
||||
@Post('/list')
|
||||
async list(@Query(ALL) query) {
|
||||
query.userId = this.ctx.user.id;
|
||||
const list = this.service.getList();
|
||||
return this.ok(list);
|
||||
}
|
||||
|
||||
@Post('/dnsProviderTypeDict')
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user