mirror of
https://github.com/certd/certd.git
synced 2026-04-24 04:17:25 +08:00
chore: 目录调整,controller转移到外部单独的目录
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { ALL, Body, Controller, Inject, Post, Provide } from '@midwayjs/core';
|
||||
import { BaseController, Constants } from '@certd/lib-server';
|
||||
import { CnameRecordService } from '../../modules/cname/service/cname-record-service.js';
|
||||
import { CnameProviderService } from '../../modules/cname/service/cname-provider-service.js';
|
||||
|
||||
/**
|
||||
* 授权
|
||||
*/
|
||||
@Provide()
|
||||
@Controller('/api/cname/provider')
|
||||
export class CnameProviderController extends BaseController {
|
||||
@Inject()
|
||||
service: CnameRecordService;
|
||||
@Inject()
|
||||
providerService: CnameProviderService;
|
||||
|
||||
getService(): CnameRecordService {
|
||||
return this.service;
|
||||
}
|
||||
|
||||
@Post('/list', { summary: Constants.per.authOnly })
|
||||
async list(@Body(ALL) body: any) {
|
||||
body.userId = this.getUserId();
|
||||
const res = await this.providerService.find({});
|
||||
return this.ok(res);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user