天气数据获取
调用免费API获取实
该技能提供后端开发全流程支持,涵盖API脚手架生成、数据库迁移管理、性能负载测试三大核心能力。适用于Node.js/Express/Fastify技术栈,集成OpenAPI规范驱动开发、PostgreSQL查询优化、API安全加固等工程实践。
安装准备
需Python 3.8+环境,克隆仓库后直接使用scripts目录下的工具脚本:
git clone https://github.com/openclaw/skills.git
cd skills/alirezarezvani/senior-backend/
API脚手架工具
# 从OpenAPI规范生成Express路由
python scripts/api_scaffolder.py openapi.yaml --framework express --output src/routes/
# 从数据库Schema反向生成
python scripts/api_scaffolder.py --from-db postgres://localhost/mydb --output src/routes/
# 从现有路由生成OpenAPI文档
python scripts/api_scaffolder.py src/routes/ --generate-spec --output openapi.yaml
数据库迁移工具
# 分析Schema并输出优化建议
python scripts/database_migration_tool.py --connection postgres://localhost/mydb --analyze
# 对比版本差异生成迁移文件
python scripts/database_migration_tool.py --connection postgres://localhost/mydb \
--compare schema/v2.sql --output migrations/
# dry-run验证迁移
python scripts/database_migration_tool.py --connection postgres://localhost/mydb \
--migrate migrations/xxx.sql --dry-run
API负载测试工具
# 50并发压测30秒
python scripts/api_load_tester.py https://api.example.com/users --concurrency 50 --duration 30
见下方输入与输出表格。
| 项目 | 内容 |
|---|---|
| 输入 | OpenAPI规范(YAML/JSON)、数据库连接字符串、API端点URL、测试配置参数(并发数/持续时间) |
| 输出 | 路由处理器代码、验证中间件、TypeScript类型定义、迁移SQL文件、回滚脚本、性能测试报告(延迟分位数/吞吐量/错误率) |
| 适用人群 | Node.js后端开发者、数据库管理员、API架构师、DevOps工程师、全栈工程师 |
| 不包含 | 前端UI组件生成、云原生部署配置(K8s/Terraform)、CI/CD流水线模板、多语言SDK生成(Java/C#/Go) |
原始链接:https://github.com/openclaw/skills/tree/main/skills/alirezarezvani/senior-backend/SKILL.md
来源类型:GitHub开源项目