优化内容

This commit is contained in:
liuwei
2025-04-09 16:05:49 +08:00
parent b1b15524d9
commit 030cfb21b0
2 changed files with 2 additions and 17 deletions

View File

@@ -29,8 +29,8 @@ class PointsDBOperator(BaseDBOperator):
super().__init__(db_manager or DBConnectionManager.get_instance())
self.logger = logging.getLogger("PointsDBOperator")
# 确保数据库表存在
self._ensure_tables_exist()
# 确保数据库表存在,后续不需要处理了。
# self._ensure_tables_exist()
def _ensure_tables_exist(self):
"""确保积分相关的数据库表存在"""

View File

@@ -136,21 +136,6 @@ class DifyPlugin(MessagePluginInterface):
# 获取用户ID
user_id = sender
# 检查是否需要扣除积分
if self.price > 0:
# 管理员和白名单检查逻辑
is_admin = False # 这里需要实现管理员检查逻辑
is_whitelist = False # 这里需要实现白名单检查逻辑
should_deduct = True
if (self.admin_ignore and is_admin) or (self.whitelist_ignore and is_whitelist):
should_deduct = False
if should_deduct:
# 这里需要实现积分扣除逻辑
# 如果积分不足,返回提示
pass
try:
# 调用Dify API获取回复
response = self._chat_with_dify(session_id, user_id, query)