refactor: 移除冗余文件并优化代码结构

- 删除多个不再使用的脚本和配置文件,包括 `auto_push.bat`, `check_and_fix_users.py`, `init.sql` 等。
- 新增 `git_push.bat` 和 `git_push.sh` 脚本以简化 Git 推送流程。
- 更新 `README.md` 以反映最新的功能和结构变化。
- 优化前端代码,添加新的页面和组件,提升用户体验。

此提交旨在清理项目结构并增强代码可维护性。
This commit is contained in:
2025-12-08 00:53:23 +08:00
parent 65d69358d7
commit 2026007045
171 changed files with 19316 additions and 19520 deletions

View File

@@ -417,3 +417,23 @@ class KnowledgeManager:
except Exception as e:
logger.error(f"获取知识库统计失败: {e}")
return {}
def update_usage_count(self, entry_ids: List[int]) -> bool:
"""更新知识库条目的使用次数"""
try:
with db_manager.get_session() as session:
# 批量更新使用次数
session.query(KnowledgeEntry).filter(
KnowledgeEntry.id.in_(entry_ids)
).update({
"usage_count": KnowledgeEntry.usage_count + 1,
"updated_at": datetime.now()
})
session.commit()
logger.info(f"成功更新 {len(entry_ids)} 个知识库条目的使用次数")
return True
except Exception as e:
logger.error(f"更新知识库使用次数失败: {e}")
return False