Merge branch 'main' of gitee.com:wg123/video-gen into main

This commit is contained in:
18610128193
2026-06-22 10:14:20 +08:00
8 changed files with 704 additions and 62 deletions
+18 -4
View File
@@ -1,10 +1,24 @@
from fastapi import APIRouter, Depends, HTTPException, Request
from fastapi import APIRouter, HTTPException
import asyncio
from redis.asyncio import Redis
from app.config import settings
from app.utils.redis import get_redis
router = APIRouter(prefix="/test", tags=["test"])
@router.get("/index")
async def test():
return {"message": "test","code":200}
redis = None
try:
redis = get_redis()
await redis.set("test", "123", ex=60)
value = await redis.get("test")
return {"message": "redis测试成功", "value": value}
except Exception as e:
if redis:
try:
await redis.close()
except:
pass
return {"message": f"redis测试失败: {str(e)}"}