first commit

This commit is contained in:
编码猿
2024-09-27 01:10:21 +08:00
commit 4bb91f7aa9
83 changed files with 952 additions and 0 deletions

74
run.sh Executable file
View File

@@ -0,0 +1,74 @@
#!/bin/bash
newTerminal() {
osascript 2>/dev/null <<EOF
tell application "System Events"
tell process "Terminal" to keystroke "t" using command down
end
tell application "Terminal"
activate
do script with command "cd \"$PWD\"; $*" in window 1
end tell
EOF
}
fastapi(){
newTerminal "echo 正在启动 FastApi请稍等... && $PWD/venv/bin/python -B main.py"
}
celery(){
echo "echo 正在启动 Celery请稍等... && celery -A src.celery.main.app worker -l info -P eventlet"
}
flower(){
echo "echo 正在启动 Flower请稍等... && celery --broker=redis://:lb714500@127.0.0.1:6379/0 flower --port=5551"
}
redis(){
echo "echo 正在启动 Redis Server请稍等... && cd C:\Program Files\Redis && redis-server.exe redis.windows.conf"
}
all(){
redis
fastapi
celery
flower
}
name='0'
menu() {
echo
echo AI爬虫 批处理启动菜单
echo
echo 1: 启动 FastApi
echo 2: 启动 Celery
echo 3: 启动 Flower WebUi
echo 4: 启动 Redis Server
echo 5: 全部 启动
echo
read -p "请输入你的选择:" name
}
menu
if [ $name == "1" ]
then
fastapi
elif [ $name == "2" ]
then
celery
elif [ $name == "3" ]
then
flower
elif [ $name == "4" ]
then
redis
elif [ $name == "5" ]
then
all
else
echo "没有符合的条件"
fi