feat(platform): Implement platform infrastructure with cloud-native support

- Add storage service (LocalAdapter + OSSAdapter stub)
- Add database connection pool with graceful shutdown
- Add logging system with winston (JSON format)
- Add environment config management
- Add async job queue (MemoryQueue + DatabaseQueue stub)
- Add cache service (MemoryCache + RedisCache stub)
- Add health check endpoints for SAE
- Add monitoring metrics for DB, memory, API

Key Features:
- Zero-code switching between local and cloud environments
- Adapter pattern for multi-environment support
- Backward compatible with legacy modules
- Ready for Aliyun Serverless deployment

Related: Platform Infrastructure Planning (docs/09-鏋舵瀯瀹炴柦/04-骞冲彴鍩虹璁炬柦瑙勫垝.md)
This commit is contained in:
2025-11-17 08:31:23 +08:00
parent a79abf88db
commit 8bba33ac89
28 changed files with 3716 additions and 51 deletions

View File

@@ -0,0 +1,26 @@
/**
* 健康检查统一导出
*
* 提供SAE健康检查端点用于存活和就绪探测。
*
* @module health
*
* @example
* ```typescript
* import { registerHealthRoutes } from '@/common/health'
* import Fastify from 'fastify'
*
* const app = Fastify()
*
* // 注册健康检查路由
* await registerHealthRoutes(app)
*
* // SAE配置示例
* // - Liveness Probe: GET /health/liveness (每10秒检查一次)
* // - Readiness Probe: GET /health/readiness (每5秒检查一次)
* ```
*/
export { registerHealthRoutes } from './healthCheck.js'
export type { HealthCheckResponse } from './healthCheck.js'