From 874cbeca785404e129a13e6bfdf47a2900697a76 Mon Sep 17 00:00:00 2001 From: zhouyonggao <1971162852@qq.com> Date: Tue, 25 Nov 2025 11:06:09 +0800 Subject: [PATCH] =?UTF-8?q?refactor(server):=20=E4=BC=98=E5=8C=96=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8=E5=90=AF=E5=8A=A8=E8=84=9A=E6=9C=AC=E5=92=8C?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E8=BF=9E=E6=8E=A5=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改run_server.sh脚本以支持环境变量和构建选项 移除mysql.go中无效的默认连接字符串并修复代码格式 --- scripts/run_server.sh | 14 +++++++++++++- server/bin/marketing-data-server | Bin 12136242 -> 12136242 bytes server/internal/db/mysql.go | 18 ++++++++---------- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/scripts/run_server.sh b/scripts/run_server.sh index ec9e755..921cb67 100644 --- a/scripts/run_server.sh +++ b/scripts/run_server.sh @@ -1,5 +1,17 @@ #!/usr/bin/env bash set -e cd "$(dirname "$0")/.."/server +set -a +[ -f .env.local ] && source .env.local +set +a +if [ "${SKIP_YMT:-0}" = "1" ]; then + unset YMT_DB_USER YMT_DB_PASSWORD YMT_DB_HOST YMT_DB_PORT YMT_DB_NAME +fi go mod tidy -go run ./cmd/server +if [ "${BUILD:-0}" = "1" ]; then + mkdir -p bin + go build -o bin/marketing-data-server ./cmd/server + PORT=${PORT:-8077} ./bin/marketing-data-server +else + go run ./cmd/server +fi diff --git a/server/bin/marketing-data-server b/server/bin/marketing-data-server index 565a89c03b7955da89cd1a1dc4cc91531e759479..e411369a91b8633da775cb4dbd43e1399188cfdf 100755 GIT binary patch delta 1116 zcmbWy?N7`B0KoC3jvhRmkjHdFou|6)es^6Z>PkgPUF9lIb-(L$m(*2`E_n(U$}^Yb zDN#ut3fIhLm@qb8*s_?}c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