wuzilong 540a3fc552 feat(dakehu): 隔离 software_code 为 buff-xp-steam-qg 并完善卡密管理 il y a 1 mois
..
app 540a3fc552 feat(dakehu): 隔离 software_code 为 buff-xp-steam-qg 并完善卡密管理 il y a 1 mois
migrations 540a3fc552 feat(dakehu): 隔离 software_code 为 buff-xp-steam-qg 并完善卡密管理 il y a 1 mois
README.md 540a3fc552 feat(dakehu): 隔离 software_code 为 buff-xp-steam-qg 并完善卡密管理 il y a 1 mois
requirements.txt 540a3fc552 feat(dakehu): 隔离 software_code 为 buff-xp-steam-qg 并完善卡密管理 il y a 1 mois
start.sh 540a3fc552 feat(dakehu): 隔离 software_code 为 buff-xp-steam-qg 并完善卡密管理 il y a 1 mois
start_prod.sh 540a3fc552 feat(dakehu): 隔离 software_code 为 buff-xp-steam-qg 并完善卡密管理 il y a 1 mois

README.md

游铛铛管理端后端 API

技术栈

  • 框架:FastAPI
  • 数据库:MySQL 8.0
  • ORM:SQLAlchemy
  • 加密:cryptography (RSA)
  • 文档:Swagger/OpenAPI

项目结构

backend-admin/
├── app/
│   ├── __init__.py
│   ├── main.py              # 应用入口
│   ├── config.py            # 配置管理
│   ├── database.py          # 数据库连接
│   ├── models/              # 数据模型
│   ├── schemas/             # Pydantic模型
│   ├── api/                 # API路由
│   │   ├── admin/           # 管理端接口
│   │   └── deps.py          # 依赖注入
│   ├── core/                # 核心功能
│   ├── middleware/          # 中间件
│   └── utils/               # 工具函数
├── requirements.txt
├── .env
└── README.md

安装依赖

建议使用项目虚拟环境,避免与 Anaconda 全局包(FastAPI/Starlette 版本不一致)冲突。需 Python 3.10+(代码使用了 str | None 等语法):

# macOS 若系统 python3 为 3.9,请用 Anaconda 或 Homebrew 的 3.10+ 创建 venv,例如:
/opt/anaconda3/bin/python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

配置

复制 .env.example 为 .env 并配置数据库连接信息。

运行

# 使用启动脚本(推荐)
./start.sh          # 开发模式
./start.sh prod     # 生产模式

# 或直接使用 uvicorn
uvicorn app.main:app --reload --host 0.0.0.0 --port 9999

API 文档

启动服务后访问:

大客户卡密隔离(software_code)

  • 普通版客户端 / 普通卡密:buff-xp-steam-sh
  • 大客户 SteamQG 客户端 / 大客户卡密:buff-xp-steam-qg
  • 部署后请执行迁移:migrations/20260929_add_software_buff_xp_steam_qg.sql
  • 生成大客户卡密时必须选择「Steam求购(大客户)」;选错软件码会导致客户端提示「卡密类型不匹配」