NBA球迷大全 v1.0.0:对话问答+数据浏览系统(DeepSeek+RAG+SQLite)

This commit is contained in:
2026-08-16 23:59:14 +08:00
commit e11677809e
21 changed files with 2927 additions and 0 deletions
Executable
+45
View File
@@ -0,0 +1,45 @@
#!/bin/bash
# NBA球迷大全 启动脚本
# 用法: ./start.sh [stop|restart|status|seed]
DIR="$(cd "$(dirname "$0")" && pwd)"
PORT=16090
PY=/home/hz1/miniconda3/envs/openclaw/bin/python3
LOG="$DIR/logs/app.log"
PID_FILE="$DIR/logs/app.pid"
start() {
if [ -f "$PID_FILE" ] && kill -0 "$(cat "$PID_FILE")" 2>/dev/null; then
echo "已在运行 PID=$(cat "$PID_FILE")"
return
fi
cd "$DIR"
nohup "$PY" api.py >> "$LOG" 2>&1 &
echo $! > "$PID_FILE"
sleep 2
echo "✅ NBA球迷大全 已启动 http://$(hostname -I 2>/dev/null | awk '{print $1}'):$PORT (PID $(cat "$PID_FILE"))"
echo " 日志: $LOG"
}
stop() {
if [ -f "$PID_FILE" ]; then
kill "$(cat "$PID_FILE")" 2>/dev/null
rm -f "$PID_FILE"
echo "已停止"
else
echo "未在运行"
fi
}
case "${1:-start}" in
start) start ;;
stop) stop ;;
restart) stop; sleep 1; start ;;
status)
if [ -f "$PID_FILE" ] && kill -0 "$(cat "$PID_FILE")" 2>/dev/null; then
echo "运行中 PID=$(cat "$PID_FILE")"; curl -s -m 5 "http://127.0.0.1:$PORT/api/health" | head -c 300; echo
else
echo "未运行"
fi ;;
seed) cd "$DIR" && "$PY" seed.py "${2:-}" ;;
*) echo "用法: $0 [start|stop|restart|status|seed]"; exit 1 ;;
esac