Files
msh-system/models-integration/start.sh

43 lines
1.0 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# 启动销帮帮API集成应用
# 支持多数据库切换和HikariCP连接池
# 检查参数
if [ "$1" != "postgresql" ] && [ "$1" != "mysql" ]; then
echo "用法: ./start.sh [postgresql|mysql]"
echo "例如: ./start.sh postgresql"
exit 1
fi
echo "启动销帮帮API集成应用..."
echo "检查Java环境..."
if ! command -v java &> /dev/null
then
echo "未找到Java环境请先安装Java 8或更高版本"
exit 1
fi
echo "检查Maven环境..."
if ! command -v mvn &> /dev/null
then
echo "未找到Maven环境请先安装Maven"
exit 1
fi
echo "编译项目..."
mvn clean compile
if [ $? -ne 0 ]; then
echo "项目编译失败"
exit 1
fi
echo "启动应用..."
echo "访问Swagger UI文档: http://localhost:5080/swagger-ui.html"
echo "多数据库测试接口: http://localhost:5080/test/database/config"
echo "HikariCP测试接口: http://localhost:5080/test/hikaricp/connection"
echo "使用$1数据库启动..."
mvn spring-boot:run -Dspring-boot.run.profiles=$1