feat: init project

This commit is contained in:
martsforever
2025-08-21 22:38:41 +08:00
commit 6ae03985bd
48 changed files with 7221 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
from fastapi import FastAPI
from sqlalchemy.sql.expression import text
from app.utils.db_utils import AsyncSessionDep
def add_test_connection_route(app: FastAPI):
@app.get("/query_llm_user_list")
async def query_llm_user_list(session: AsyncSessionDep):
result = await session.execute(text("select * from llm_user"))
return [dict(row._mapping) for row in result]
@app.get("/query_llm_user")
async def query_llm_user(username: str, session: AsyncSessionDep):
result = await session.execute(text("select * from llm_user where username = :username"), {"username": username})
list = [dict(row._mapping) for row in result]
return {
"result": list[0] if list else None
}