完善接单平台上传与物品规则

This commit is contained in:
yml2213
2026-07-25 15:56:18 +08:00
parent f6d3f00f21
commit a2587eda01
40 changed files with 4978 additions and 1008 deletions
+21 -1
View File
@@ -47,7 +47,7 @@ print_usage() {
注意:
--reset-db 会删除本机开发库里的订单、任务、后台用户、审计日志和迁移记录。
它不会删除 apps/backend/data 下的平台 JSON 配置,也不会删除 node_modules 缓存 volume。
它不会删除 apps/backend/data 下的平台 JSON 配置、MinIO 文件数据和 node_modules 缓存 volume。
EOF
}
@@ -86,6 +86,18 @@ read_env_value() {
' "${ENV_FILE}"
}
read_effective_env_value() {
local key="$1"
local default_value="$2"
local value="${!key:-}"
if [[ -z "${value}" ]]; then
value="$(read_env_value "${key}" || true)"
fi
printf '%s\n' "${value:-${default_value}}"
}
ensure_docker() {
command -v docker >/dev/null 2>&1 || fail "未找到 docker,请先安装并启动 Docker Desktop for Mac。"
docker compose version >/dev/null 2>&1 || fail "未找到 docker compose 插件,请升级 Docker Desktop。"
@@ -270,6 +282,7 @@ start_dev_stack() {
log "启动 Mac 本机 Docker 开发环境"
if "${COMPOSE_CMD[@]}" up -d --build; then
wait_for_service postgres "PostgreSQL"
wait_for_service minio "MinIO"
wait_for_service backend "后端"
wait_for_service frontend "前端"
wait_for_service web "Web 入口"
@@ -327,6 +340,9 @@ print_diagnostics() {
warn "前端最近日志:"
"${COMPOSE_CMD[@]}" logs --tail=80 frontend || true
warn "MinIO 最近日志:"
"${COMPOSE_CMD[@]}" logs --tail=80 minio || true
warn "后端 ready 接口:"
"${COMPOSE_CMD[@]}" exec -T backend sh -lc 'curl -fsS http://127.0.0.1:3000/health/ready || true' || true
@@ -334,10 +350,14 @@ print_diagnostics() {
}
print_endpoints() {
local minio_console_port
minio_console_port="$(read_effective_env_value MINIO_CONSOLE_PORT 19001)"
log "常用入口"
printf '%s\n' " 前端、后台、领取页:http://localhost"
printf '%s\n' " 后端健康检查:http://localhost/health"
printf '%s\n' " 后端 ready 检查:http://localhost/health/ready"
printf '%s\n' " MinIO 控制台:http://localhost:${minio_console_port}"
}
main() {