|
@@ -12,7 +12,7 @@ from starlette.middleware.cors import CORSMiddleware
|
|
|
|
|
|
from LocalModel import CustomLogin, SaveUser, QueryUser, DeleteUser
|
|
|
from logic import *
|
|
|
-from model import CustomUser, UserInfo, database
|
|
|
+from model import CustomUser, UserInfo, ZaneTest, database
|
|
|
|
|
|
API_KEY = "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"
|
|
|
|
|
@@ -296,9 +296,12 @@ async def test(request: Request):
|
|
|
request_origin = request.headers.get('origin')
|
|
|
if request_origin is None:
|
|
|
request_origin = "unknown"
|
|
|
- content = {"message": "Hello World" + request_origin, "db": "disconnect!!!"}
|
|
|
+ content = {"message": "Hello World" +
|
|
|
+ request_origin, "db": "disconnect!!!"}
|
|
|
headers = {'Access-Control-Allow-Origin': request_origin}
|
|
|
- content["db"] = "is_closed: " + str(database.is_closed()) + " is_usable:" + str(database.is_connection_usable())
|
|
|
+ content["db"] = "is_closed: " + \
|
|
|
+ str(database.is_closed()) + " is_usable:" + \
|
|
|
+ str(database.is_connection_usable())
|
|
|
try:
|
|
|
dt = CustomUser.select()
|
|
|
for item in dt:
|
|
@@ -310,6 +313,6 @@ async def test(request: Request):
|
|
|
|
|
|
@app.get("/api/test2")
|
|
|
async def test2():
|
|
|
- users = UserInfo.select().where(UserInfo.customer != None)
|
|
|
+ users = ZaneTest.select().where(ZaneTest.a != None)
|
|
|
users = [__build_user_object(dt) for dt in users]
|
|
|
return {"message": "Hello World", "users": users}
|