cursor-init/package.json
expressgy 2ee70e5d42 feat: 完成健康检查接口和Swagger文档完善
 健康检查功能:
- 实现完整的健康检查接口(/api/health, /api/health/detailed)
- 支持MySQL和Redis依赖状态检查
- 包含系统信息、性能指标监控
- 修复this上下文问题,确保服务方法正常调用
- 添加全面的健康检查测试用例

📝 Swagger文档优化:
- 创建全局响应Schema定义和错误码说明
- 完善API文档,包含详细的错误码表格
- 添加JWT认证说明和响应格式示例
- 增加全局组件、响应模板和示例
- 创建Swagger文档功能测试

🎯 任务完成:
-  5.0 健康检查接口 - 实现系统和依赖健康状态监控
-  7.0 Swagger文档完善 - 增加全局响应示例和错误码说明

📁 新增文件:
- src/controllers/health.controller.ts - 健康检查控制器
- src/services/health.service.ts - 健康检查服务层
- src/type/health.type.ts - 健康检查类型定义
- src/validators/health.response.ts - 健康检查响应验证
- src/validators/global.response.ts - 全局响应Schema定义
- src/tests/health.test.ts - 健康检查功能测试
- src/tests/redis.test.ts - Redis连接测试
- src/tests/swagger.test.ts - Swagger文档功能测试
2025-06-28 22:09:02 +08:00

58 lines
1.9 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"name": "cursor-init",
"version": "0.1.0",
"description": "Bun + Elysia 后端API项目支持MySQL、JWT、Swagger、Vitest等",
"author": "hotok <x71291@outlook.com>",
"license": "MIT",
"repository": {
"type": "gitea",
"url": "git+https://github.com/yourname/yourrepo.git"
},
"type": "module",
"private": true,
"engines": {
"bun": ">=1.0.25"
},
"devDependencies": {
"@types/bun": "^1.0.25",
"@types/redis": "^4.0.11",
"@types/winston": "^2.4.4",
"@typescript-eslint/eslint-plugin": "^8.35.0",
"@typescript-eslint/parser": "^8.35.0",
"eslint": "^9.29.0",
"eslint-config-prettier": "^10.1.5",
"prettier": "^3.6.2",
"typescript": "^5.8.3",
"vitest": "^3.2.4"
},
"dependencies": {
"@elysiajs/jwt": "^1.3.1",
"@elysiajs/swagger": "^1.3.0",
"@types/ua-parser-js": "^0.7.39",
"chalk": "^5.4.1",
"mysql2": "^3.14.1",
"nanoid": "^5.1.5",
"picocolors": "^1.1.1",
"redis": "^5.5.6",
"ua-parser-js": "^2.0.4",
"undici": "^7.11.0",
"winston": "^3.17.0",
"winston-daily-rotate-file": "^5.0.0"
},
"scripts": {
"dev": "bun --watch --env-file=.env --hot src/server.ts",
"start": "bun --env-file=.env.prod src/server.ts",
"test": "bun test",
"vitest": "bun --env-file=.env x vitest run",
"test:watch": "bun test --watch",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"format": "prettier --write .",
"format:check": "prettier --check .",
"check": "bun run lint && bun run format:check",
"fix": "bun run lint:fix && bun run format",
"demo:logger": "bun src/demo/logger-demo.ts",
"demo:logger:prod": "NODE_ENV=production bun src/demo/logger-demo.ts"
}
}