mirror of
https://github.com/certd/certd.git
synced 2026-04-24 12:27:25 +08:00
chore:
This commit is contained in:
@@ -29,6 +29,12 @@ export class PluginController extends BaseController {
|
||||
return this.ok(group);
|
||||
}
|
||||
|
||||
@Post('/getDefineByType', { summary: Constants.per.authOnly })
|
||||
async getDefineByType(@Body('type') type: string) {
|
||||
const define = await this.service.getDefineByType(type);
|
||||
return this.ok(define);
|
||||
}
|
||||
|
||||
@Post('/config', { summary: Constants.per.authOnly })
|
||||
async config(@Body(ALL) body: { id?: number; name?: string; type: string }) {
|
||||
const config = await this.pluginConfigService.getPluginConfig(body);
|
||||
|
||||
@@ -21,4 +21,8 @@ export class BuiltInPluginService {
|
||||
getGroups() {
|
||||
return cloneDeep(pluginGroups);
|
||||
}
|
||||
|
||||
getByType(type: string) {
|
||||
return pluginRegistry.getDefine(type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,4 +127,8 @@ export class PluginService extends BaseService<PluginEntity> {
|
||||
}
|
||||
throw new Error('参数错误: id 和 name 必须有一个');
|
||||
}
|
||||
|
||||
async getDefineByType(type: string) {
|
||||
return this.builtInPluginService.getByType(type);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user