优化内容
This commit is contained in:
@@ -29,8 +29,8 @@ class PointsDBOperator(BaseDBOperator):
|
|||||||
super().__init__(db_manager or DBConnectionManager.get_instance())
|
super().__init__(db_manager or DBConnectionManager.get_instance())
|
||||||
self.logger = logging.getLogger("PointsDBOperator")
|
self.logger = logging.getLogger("PointsDBOperator")
|
||||||
|
|
||||||
# 确保数据库表存在
|
# 确保数据库表存在,后续不需要处理了。
|
||||||
self._ensure_tables_exist()
|
# self._ensure_tables_exist()
|
||||||
|
|
||||||
def _ensure_tables_exist(self):
|
def _ensure_tables_exist(self):
|
||||||
"""确保积分相关的数据库表存在"""
|
"""确保积分相关的数据库表存在"""
|
||||||
|
|||||||
@@ -136,21 +136,6 @@ class DifyPlugin(MessagePluginInterface):
|
|||||||
# 获取用户ID
|
# 获取用户ID
|
||||||
user_id = sender
|
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:
|
try:
|
||||||
# 调用Dify API获取回复
|
# 调用Dify API获取回复
|
||||||
response = self._chat_with_dify(session_id, user_id, query)
|
response = self._chat_with_dify(session_id, user_id, query)
|
||||||
|
|||||||
Reference in New Issue
Block a user