抓包确认 /aj/game/exchangegoods 必须 POST + form body,并带 x-xsrf-token/Origin/_failtoast;原实现用 GET,服务端返回 400404 迷路页,接口稳定 502。 - 兑换改为 POST + form,query 与 body 同带 F/goods_id/_t - 请求失败分类:连接超时=未提交、其他网络错误/5xx/非 JSON=结果未知、 4xx=未提交、401 类错误码=CK 失效 - 100002 是参数校验错误(实测 GoodsID required),移出鉴权失效集合, 真实未登录是 400002 - 新增 /aj/mall/detail 预检(价格/余额/库存/兑换按钮),fail-close - 复核只认余额变化,取消“库存变化即成功”的假阳性;缺字段不再写 0 - 复核请求用 8s 短超时,避免打穿前端 120s - 同一账号兑换加进程内非阻塞锁,并发请求返回 409;余额回写失败降级为 结果未知 502 - 兑换记录状态列映射 2=已发放,其余展示原始状态码 - 版本 0.4.29 → 0.4.31
63 lines
1.8 KiB
TOML
63 lines
1.8 KiB
TOML
[project]
|
|
name = "live-hub-py"
|
|
version = "0.4.31"
|
|
description = "直播账号运营 Web 后台"
|
|
readme = "README.md"
|
|
requires-python = ">=3.12,<3.13"
|
|
dependencies = [
|
|
"requests[socks]>=2.31.0",
|
|
"pycryptodome>=3.19.0",
|
|
"numpy>=1.24.0",
|
|
"opencv-python-headless>=4.8.0",
|
|
"Pillow>=10.0.0",
|
|
"loguru>=0.7.0",
|
|
"fastapi>=0.110.0",
|
|
"uvicorn[standard]>=0.27.0",
|
|
"sqlalchemy>=2.0.0",
|
|
"python-jose[cryptography]>=3.3.0",
|
|
"bcrypt>=4.0.0",
|
|
"pydantic>=2.0.0",
|
|
"python-multipart>=0.0.9",
|
|
"alembic>=1.18.4",
|
|
"websockets>=16.0",
|
|
# macOS Intel wheels end at 1.23.x; newer releases only cover arm64 on macOS.
|
|
"onnxruntime>=1.18.0,<1.24",
|
|
"scipy>=1.13.0",
|
|
"pyexecjs>=1.5.1",
|
|
"pymysql>=1.1,<2",
|
|
# P0 订单读取适配层:连 order_site 的 PostgreSQL 只读库(规划 §6.5)。
|
|
# 全项目只有 external_order_source.py 一处跨库;URL 用 postgresql+psycopg://
|
|
"psycopg[binary]>=3.2,<4",
|
|
"curl-cffi>=0.13",
|
|
"segno>=1.6",
|
|
# 在线协作的图片上传:走 S3 兼容接口写阿里云 OSS(内网 endpoint)。
|
|
# 只在 STORAGE_MODE=oss 时才导入,本地开发/测试用本地目录后端,不装也能跑。
|
|
"boto3>=1.34",
|
|
]
|
|
|
|
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["core", "utils", "web"]
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|
|
markers = [
|
|
"migration: 创建临时 MySQL 库并执行 Alembic 迁移链;比普通用例慢很多",
|
|
]
|
|
|
|
[tool.ruff.lint.per-file-ignores]
|
|
# FastAPI evaluates dependency metadata in route parameter defaults by design.
|
|
"web/backend/**/*.py" = ["B008"]
|
|
# 虎牙路由共享层集中 re-export 依赖。
|
|
"web/backend/routers/huya/_common.py" = ["F401"]
|
|
|
|
[dependency-groups]
|
|
dev = [
|
|
"pyright>=1.1.411",
|
|
"pytest>=9.1.1",
|
|
"ruff>=0.12.0",
|
|
]
|