This commit is contained in:
xiaojunnuo
2024-12-03 00:55:37 +08:00
parent febe87508c
commit 393ea27fa4
5 changed files with 29 additions and 4 deletions
@@ -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);
}
}