fix(wecom): 修复 MCP Factory 注入失败导致 API 无法启动
WecomPluginQueryService 不能用 import type,否则 Nest 拿不到 design:type。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { Injectable, Logger } from '@nestjs/common';
|
||||
import { Inject, Injectable, Logger } from '@nestjs/common';
|
||||
import { allowedWecomPluginMcpTools } from '@dukang/shared-types';
|
||||
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
||||
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
||||
import type { IncomingMessage, ServerResponse } from 'node:http';
|
||||
import { WECOM_PLUGIN_MCP_TOOL_DEFS } from './wecom-plugin-mcp.tools';
|
||||
import type { WecomPluginQueryService } from './wecom-plugin-query.service';
|
||||
import { WecomPluginQueryService } from './wecom-plugin-query.service';
|
||||
import type { WecomPluginRuntime } from './wecom-plugin.types';
|
||||
import { wecomPluginCaller } from './wecom-plugin.util';
|
||||
|
||||
@@ -34,7 +34,7 @@ export function createWecomPluginMcpServer(
|
||||
export class WecomPluginMcpFactory {
|
||||
private readonly logger = new Logger(WecomPluginMcpFactory.name);
|
||||
|
||||
constructor(private readonly query: WecomPluginQueryService) {}
|
||||
constructor(@Inject(WecomPluginQueryService) private readonly query: WecomPluginQueryService) {}
|
||||
|
||||
async handle(
|
||||
req: IncomingMessage & { body?: unknown; headers: IncomingMessage['headers'] },
|
||||
|
||||
Reference in New Issue
Block a user