# nest-fastify-seed **Repository Path**: zhangyang_gitee/nest-fastify-seed ## Basic Information - **Project Name**: nest-fastify-seed - **Description**: 基于fastify nest模板 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-09-15 - **Last Updated**: 2025-09-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### 内置过滤器 ``` BadRequestException:表示客户端发送了无效请求,如请求语法错误、缺少参数等。 UnauthorizedException:表示客户端未提供有效的身份验证凭据。 NotFoundException:表示客户端请求的资源不存在。 ForbiddenException:表示客户端无权访问请求的资源。 NotAcceptableException:表示客户端请求的资源无法用请求标头中提供的值响应。 RequestTimeoutException:表示服务器在等待请求时已超时。 ConflictException:表示客户端请求的资源已经存在且请求无法成功。 GoneException:表示请求的资源不再可用。 PayloadTooLargeException:表示请求的负载大小超出了服务器可以处理的范围。 UnsupportedMediaTypeException:表示请求的媒体类型不受支持。 UnprocessableException:表示客户端发送的请求无法处理。 InternalServerErrorException:表示服务器发生内部错误。 NotImplementedException:表示请求的功能尚未实现。 BadGatewayException:表示网关或代理服务器从上游服务器接收到无效响应。 ServiceUnavailableException:表示服务器当前无法处理请求,因为它过载或停机维护。 GatewayTimeoutException:表示网关或代理服务器在等待上游服务器响应时已超时。 ``` ### 内置CRUD ``` 快捷生成curd nest g res modules/pan/pan-scan --no-spec ``` ### 生命周期 ``` NestJS 的请求处理链路(以 HTTP 为例)为: 请求进入 → 守卫(Guards)→ 拦截器(请求前)→ 管道(Pipes)→ 控制器(Controller)→ 服务(Service)→ 控制器返回结果 → 拦截器(响应后)→ 过滤器(仅异常时)→ 响应返回 ``` ### 杀进程 ``` 根据找到的 PID (进程ID),终止进程: netstat -ano | findstr :13333 taskkill /PID PID号 /F taskkill /PID 10304 /F ``` ### 自定义CURD自动生成 <更具数据库> ``` node code.js 1. 请输入模块路径名(示例:system/user-info):hik/student-inout-message2 2. 请输入要生成代码的数据库表名(示例:yh_sys_user_info): yh_hik_student_inout_message2 3. 请输入中文名称(示例:用户信息):海康人脸进出记录2 ``` ### 自定义CURD自动生成 <仅 Service/Controller/Module 不生成entity> ``` node code-no-db.js 1. 请输入模块路径名(示例:system/user-info):hik/student-inout-message2 3. 请输入中文名称(示例:用户信息):海康人脸进出记录2 ```