From 487848d3982b8f1e508f195bb4453c81adf7cc2b Mon Sep 17 00:00:00 2001 From: cool Date: Fri, 26 Jan 2024 19:05:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=92=E4=BB=B6=E8=B0=83=E7=94=A8=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/demo/controller/open/plugin.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/modules/demo/controller/open/plugin.ts diff --git a/src/modules/demo/controller/open/plugin.ts b/src/modules/demo/controller/open/plugin.ts new file mode 100644 index 0000000..4c69760 --- /dev/null +++ b/src/modules/demo/controller/open/plugin.ts @@ -0,0 +1,18 @@ +import { CoolController, BaseController } from '@cool-midway/core'; +import { PluginService } from '../../../plugin/service/info'; +import { Get, Inject } from '@midwayjs/core'; + +/** + * 插件 + */ +@CoolController() +export class OpenDemoPluginController extends BaseController { + @Inject() + pluginService: PluginService; + + @Get('/invoke', { summary: '调用插件' }) + async invoke() { + const result = await this.pluginService.invoke('test', 'show', 1, 2); + return this.ok(result); + } +}