#!/usr/bin/env bash
# 将 web/promotion/视频发布 导入到 data/uploads + MongoDB site_assets（无需后台手动上传）
# 依赖：server/.env 中 MONGODB_URI、MONGODB_DB（与 API 一致）；本机可连 Mongo
#
# 用法：
#   ./scripts/import-promotion-to-api.sh -site=你的站点MongoID
#   ./scripts/import-promotion-to-api.sh -site=xxx -src=/www/yh_web/web/promotion/视频发布 -upload=/www/yh_web/data/uploads
#   ./scripts/import-promotion-to-api.sh -site=xxx -dry-run
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT/server"
exec go run -mod=vendor ./cmd/promotion-import/ "$@"
