Compare commits

..

No commits in common. "fba2513b5f2d7bdade541fbc4961cb766cd9a97a" and "5ad3062457810102a31e054511b6c56520c027c9" have entirely different histories.

2 changed files with 0 additions and 41 deletions

View File

@ -1,41 +0,0 @@
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
async def root():
return "welcome to fastAPI!"
@app.get("/script/getscriparam")
async def getscriparam():
data = {"bounceRate": {"from": 0.3, "to": 0.4}, "ctr": {"from": 0.03, "to": 0.05},
"interaction": {"from": 20, "to": 30},
"pagesToViewPerSession": {"from": 2, "to": 3}, "sessionsPerUser": {"from": 2, "to": 3}}
return {
"code": 0,
"msg": "ok",
"data": data
}
@app.get("/script/success")
async def do_success():
data = {}
return {
"code": 0,
"msg": "ok",
"data": data
}
@app.get("/script/failed")
async def do_failed(reason: str = None):
# 假设这里记录失败原因到日志或数据库
print(f"失败原因: {reason}") # 实际应用中应使用更专业的日志记录方式
return {
"code": 0,
"msg": "ok",
"data": {}
}