规范化ezapi
This commit is contained in:
parent
0874573935
commit
8e22ccee40
|
@ -56,7 +56,7 @@ async def list_table(database_name: str):
|
||||||
|
|
||||||
|
|
||||||
@app.get("/api/"+version+"/database/{database_name}/table/{table_name}", status_code=200)
|
@app.get("/api/"+version+"/database/{database_name}/table/{table_name}", status_code=200)
|
||||||
async def check_database(database_name: str, table_name: str):
|
async def check_table(database_name: str, table_name: str):
|
||||||
await reqlim.get_req()
|
await reqlim.get_req()
|
||||||
ret = await core.check_table(database_name, table_name)
|
ret = await core.check_table(database_name, table_name)
|
||||||
if (ret is not None):
|
if (ret is not None):
|
||||||
|
@ -92,7 +92,7 @@ async def list_key(database_name: str, table_name: str):
|
||||||
|
|
||||||
|
|
||||||
@app.get("/api/"+version+"/database/{database_name}/table/{table_name}/key/{key_name}/check", status_code=200)
|
@app.get("/api/"+version+"/database/{database_name}/table/{table_name}/key/{key_name}/check", status_code=200)
|
||||||
async def create_key(database_name: str, table_name: str, key_name: int | str):
|
async def check_key(database_name: str, table_name: str, key_name: int | str):
|
||||||
await reqlim.get_req()
|
await reqlim.get_req()
|
||||||
ret = await core.check_key(database_name, table_name, key_name)
|
ret = await core.check_key(database_name, table_name, key_name)
|
||||||
if (ret is not None):
|
if (ret is not None):
|
||||||
|
@ -121,7 +121,7 @@ async def delete_key(database_name: str, table_name: str, key_name: int | str):
|
||||||
|
|
||||||
|
|
||||||
@app.patch("/api/"+version+"/database/{database_name}/table/{table_name}/key/{key_name}", status_code=200)
|
@app.patch("/api/"+version+"/database/{database_name}/table/{table_name}/key/{key_name}", status_code=200)
|
||||||
async def create_key(database_name: str, table_name: str, key_name: int | str, data: KeyItem):
|
async def update_key(database_name: str, table_name: str, key_name: int | str, data: KeyItem):
|
||||||
await reqlim.get_req()
|
await reqlim.get_req()
|
||||||
if (data.data is None):
|
if (data.data is None):
|
||||||
return {"status": 400, "errormsg": "No data"}
|
return {"status": 400, "errormsg": "No data"}
|
||||||
|
@ -132,7 +132,7 @@ async def create_key(database_name: str, table_name: str, key_name: int | str, d
|
||||||
|
|
||||||
|
|
||||||
@app.get("/api/"+version+"/database/{database_name}/table/{table_name}/key/{key_name}", status_code=200)
|
@app.get("/api/"+version+"/database/{database_name}/table/{table_name}/key/{key_name}", status_code=200)
|
||||||
async def create_key(database_name: str, table_name: str, key_name: int | str):
|
async def get_key(database_name: str, table_name: str, key_name: int | str):
|
||||||
await reqlim.get_req()
|
await reqlim.get_req()
|
||||||
ret = await core.get_key(database_name, table_name, key_name)
|
ret = await core.get_key(database_name, table_name, key_name)
|
||||||
if (ret is not None):
|
if (ret is not None):
|
||||||
|
|
Loading…
Reference in New Issue