|
@@ -11,6 +11,7 @@ from pymysql import OperationalError
|
|
from starlette.middleware.cors import CORSMiddleware
|
|
from starlette.middleware.cors import CORSMiddleware
|
|
|
|
|
|
from LocalModel import CustomLogin, SaveUser, QueryUser, DeleteUser
|
|
from LocalModel import CustomLogin, SaveUser, QueryUser, DeleteUser
|
|
|
|
+from db_decorator import peewee_db_close
|
|
from logic import *
|
|
from logic import *
|
|
from model import CustomUser, UserInfo, ZaneTest, database
|
|
from model import CustomUser, UserInfo, ZaneTest, database
|
|
|
|
|
|
@@ -312,7 +313,10 @@ async def test(request: Request):
|
|
|
|
|
|
|
|
|
|
@app.get("/api/test2")
|
|
@app.get("/api/test2")
|
|
|
|
+@peewee_db_close
|
|
async def test2():
|
|
async def test2():
|
|
|
|
+
|
|
zane_list = ZaneTest.select().where(ZaneTest.a != None)
|
|
zane_list = ZaneTest.select().where(ZaneTest.a != None)
|
|
zane_list = [dt.a for dt in zane_list]
|
|
zane_list = [dt.a for dt in zane_list]
|
|
|
|
+
|
|
return {"message": "Hello World", "users": zane_list}
|
|
return {"message": "Hello World", "users": zane_list}
|