diff --git a/apps/api/src/stores/stores.controller.ts b/apps/api/src/stores/stores.controller.ts index 4879f5e..6fdf7cf 100644 --- a/apps/api/src/stores/stores.controller.ts +++ b/apps/api/src/stores/stores.controller.ts @@ -5,6 +5,7 @@ import { Get, Headers, HttpCode, + Inject, Param, Patch, Post, @@ -39,7 +40,11 @@ type HttpResponse = { status: (status: number) => HttpResponse }; @ApiBearerAuth('access-token') @Controller() export class PlatformsController { - public constructor(private readonly platformsService: PlatformsService) {} + // tsx/esbuild 不生成 design:paramtypes 元数据,控制器依赖必须显式 @Inject(与 auth.controller 一致) + public constructor( + @Inject(PlatformsService) + private readonly platformsService: PlatformsService, + ) {} @Get('platforms') @ApiOperation({ summary: '获取已启用的平台及非敏感能力目录' }) @@ -75,7 +80,9 @@ export class PlatformsController { @ApiBearerAuth('access-token') @Controller('stores') export class StoresController { - public constructor(private readonly storesService: StoresService) {} + public constructor( + @Inject(StoresService) private readonly storesService: StoresService, + ) {} @Get() @ApiOperation({ summary: '按平台分页列出当前工作空间的门店' }) @@ -260,7 +267,9 @@ export class StoresController { @ApiBearerAuth('access-token') @Controller('operations') export class OperationsController { - public constructor(private readonly storesService: StoresService) {} + public constructor( + @Inject(StoresService) private readonly storesService: StoresService, + ) {} @Get(':operationId') @ApiOperation({ summary: '读取当前工作空间的异步操作状态' })