MCPcopy Create free account
hub / github.com/ZyphrZero/z.ai2api_python / delete_token

Method delete_token

app/services/token_dao.py:220–228  ·  view source on GitHub ↗

删除 Token(级联删除统计数据)

(self, token_id: int)

Source from the content-addressed store, hash-verified

218 logger.error(f"❌ 更新 Token 类型失败: {e}")
219
220 async def delete_token(self, token_id: int):
221 """删除 Token(级联删除统计数据)"""
222 try:
223 async with self.get_connection() as conn:
224 await conn.execute("DELETE FROM tokens WHERE id = ?", (token_id,))
225 await conn.commit()
226 logger.info(f"✅ 删除 Token: id={token_id}")
227 except Exception as e:
228 logger.error(f"❌ 删除 Token 失败: {e}")
229
230 async def delete_tokens_by_ids(self, token_ids: List[int]) -> int:
231 """批量删除 Token(级联删除统计数据)"""

Callers 1

delete_tokenFunction · 0.80

Calls 1

get_connectionMethod · 0.95

Tested by

no test coverage detected