fix
Some checks failed
部署后端服务 / 🧪 测试后端 (push) Failing after 5m8s
部署后端服务 / 🚀 构建并部署 (push) Has been skipped
部署后端服务 / 🔄 回滚部署 (push) Has been skipped

This commit is contained in:
xujiang
2025-07-10 18:09:11 +08:00
parent 35004f224e
commit 010fe2a8c7
96 changed files with 23709 additions and 19 deletions

45
backend-old/start.sh Executable file
View File

@ -0,0 +1,45 @@
#!/bin/bash
# 摄影作品集后端启动脚本
echo "=== 摄影作品集后端启动 ==="
# 检查Go是否安装
if ! command -v go &> /dev/null; then
echo "错误: Go 未安装,请先安装 Go 1.21 或更高版本"
exit 1
fi
# 检查Go版本
GO_VERSION=$(go version | cut -d' ' -f3 | sed 's/go//')
echo "Go 版本: $GO_VERSION"
# 进入项目目录
cd "$(dirname "$0")"
# 创建必要的目录
echo "创建必要的目录..."
mkdir -p uploads/photos
mkdir -p uploads/thumbnails
mkdir -p uploads/temp
mkdir -p logs
# 安装依赖
echo "安装Go模块依赖..."
go mod tidy
# 设置环境变量
export CONFIG_PATH="configs/config.dev.yaml"
# 启动服务器
echo "启动后端服务器..."
echo "配置文件: $CONFIG_PATH"
echo "访问地址: http://localhost:8080"
echo "健康检查: http://localhost:8080/health"
echo "API文档: 请查看 test_api.http 文件"
echo ""
echo "按 Ctrl+C 停止服务器"
echo ""
# 运行服务器
go run cmd/server/main_simple.go