Controller/Service separation and Custom Decorators.
Role: Handler only. Delegate all logic to Services.
Context: Use ExecutionContext helpers (switchToHttp()) for platform-agnostic code.
Custom Decorators:
@Request() req -> req.user (Not type-safe).@CurrentUser(), @DeviceIp().export const CurrentUser = createParamDecorator(
(data: unknown, ctx: ExecutionContext) =>
ctx.switchToHttp().getRequest().user,
);
whitelist: true: Strip properties without decorators.forbidNonWhitelisted: true: Throw error if unknown properties exist.transform: true: Auto-convert primitives (String '1' -> Number 1) and instantiate DTO classes.@nestjs/swagger CLI plugin (nest-cli.json) to auto-detect DTO properties without manual @ApiProperty() tags.map() to wrap success responses (e.g. { data: T }).PageDto and ApiResponse.catchError() to map low-level errors (DB constraints) to HttpException (e.g. ConflictException) before they hit the global filter.Scope.REQUEST.ValidationPipe globally.ParseIntPipe, ParseUUIDPipe on all ID parameters.@Get(':id')
findOne(@Param('id', ParseIntPipe) id: number) { ... }
OnModuleInit for connection setup.OnApplicationShutdown for cleanup. (Requires enableShutdownHooks()).npx skills add ngxtm/NestJS Controllers & Services下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer