Skip to content

Commit

Permalink
Merge pull request #97 from HisAtri/patch-b1
Browse files Browse the repository at this point in the history
kv数据库删除接口:修改请求体key
  • Loading branch information
HisAtri authored Nov 9, 2024
2 parents 8580444 + 12d8f9f commit 17d1200
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def kv_del(table_name: str, para: dict) -> tuple[bool, any, int]:
check_status: tuple[bool, str, int] = validate_table_name(table_name)
if not check_status[0]:
return check_status
keys = para.get("key")
keys = para.get("keys")
if not keys:
return False, "Missing keys.", 422
elif type(keys) is not list:
Expand Down Expand Up @@ -103,6 +103,8 @@ def kv_del(table_name: str, para: dict) -> tuple[bool, any, int]:
"timezone": int(datetime.now(timezone.utc).timestamp()),
}

return True, results, 200


def custom_sql(sql: str) -> list[dict]:
with sqlite3.connect(saved_path) as conn:
Expand Down

0 comments on commit 17d1200

Please sign in to comment.