- 抽屉拖入/选图 → 立刻 POST /api/assets/upload/ 传进 TOS 桶拿 asset id(每张带上传中/完成/失败态, 首图标「主图」=cover_asset);上传未完成禁用「创建商品」 - 点创建 → POST /api/products/ 直接带 cover_asset + images inline 落库,一步到位,不再「先建后传图」 (那条因传图接口需先有商品 ID,与「创建必须带图」校验天然冲突 → 建商品恒 400「商品创建失败」) - 同步读取 File:addImages 一进来就 Array.from 取文件,避免 pickImage 紧接的 input.value="" 清空 input.files 导致「第一次点没反应、第二次才上传」;选好即发起上传,不靠会滞后的 effect - 后端保留「创建必须带图」校验(upload-first 下可满足、且正确) 真实接口验:独立上传 201 → 带 cover+images 创建 201(落库)→ 无图创建 400;tsc/build/后端测试通过。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
AirShelf Backend
All backend code lives under AirShelf/core/backend by project decision.
Local bootstrap
cd /Users/maidong/Desktop/zyc/qiyuan_gitea/AirShelf/core/backend
python3.12 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
python manage.py migrate
python manage.py runserver 0.0.0.0:8000
Start workers in separate terminals:
cd /Users/maidong/Desktop/zyc/qiyuan_gitea/AirShelf/core/backend
source .venv/bin/activate
celery -A airshelf worker -l info -P threads -c 4 # 线程池 4 并发(出图/视频可并行;勿用 -P solo 串行)
ffmpeg must be available on PATH for Stage5 export jobs.
Runtime layout
- Django project:
airshelf - Domain apps:
apps/* - Settings module:
airshelf.settings.development - Celery app:
airshelf.celery
Secrets must be supplied by environment variables or .env; never commit values from account.md.
Useful commands
python manage.py check
python manage.py makemigrations --check --dry-run
python manage.py migrate
python manage.py bootstrap_volcano_models
python manage.py test apps.accounts apps.projects apps.billing