Initial commit: 浼佷笟寰俊 AI 鏈哄櫒浜哄姪鐞?MVP

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
bujie9527
2026-02-05 16:36:32 +08:00
commit 59275ed4dc
126 changed files with 9120 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
# 最小闭环验收脚本:健康检查、登录、可选回调验签
# 用法: BASE_URL=http://localhost ./acceptance.sh 或 BASE_URL=https://your-domain.com ./acceptance.sh
set -e
BASE_URL="${BASE_URL:-http://localhost}"
echo "=== 1. Health ==="
r=$(curl -s -o /dev/null -w "%{http_code}" "$BASE_URL/api/health")
if [ "$r" != "200" ]; then
echo "FAIL health: got $r"
exit 1
fi
echo "OK"
echo "=== 2. Login ==="
login=$(curl -s -X POST "$BASE_URL/api/auth/login" -H "Content-Type: application/json" -d '{"username":"admin","password":"admin"}')
code=$(echo "$login" | grep -o '"code":[0-9]*' | cut -d: -f2)
if [ "$code" != "0" ]; then
echo "FAIL login: $login"
exit 1
fi
echo "OK"
echo "=== 3. WeCom callback GET (验签需正确 Token/Key此处仅检查 200 或 400) ==="
wecom_get=$(curl -s -o /dev/null -w "%{http_code}" "$BASE_URL/api/wecom/callback?msg_signature=xxx&timestamp=1&nonce=1&echostr=xxx")
if [ "$wecom_get" != "200" ] && [ "$wecom_get" != "400" ]; then
echo "WARN wecom GET: got $wecom_get (expected 200 or 400)"
fi
echo "OK (status $wecom_get)"
echo "=== All checks passed ==="