fix: auto-fix code issues (cron)
- 修复重复导入/字段 - 修复异常处理 - 修复PEP8格式问题 - 添加类型注解
This commit is contained in:
@@ -17,7 +17,6 @@ DB_PATH = os.getenv("DB_PATH", "/app/data/insightflow.db")
|
||||
# Constants
|
||||
UUID_LENGTH = 8 # UUID 截断长度
|
||||
|
||||
|
||||
@dataclass
|
||||
class Project:
|
||||
id: str
|
||||
@@ -26,7 +25,6 @@ class Project:
|
||||
created_at: str = ""
|
||||
updated_at: str = ""
|
||||
|
||||
|
||||
@dataclass
|
||||
class Entity:
|
||||
id: str
|
||||
@@ -47,7 +45,6 @@ class Entity:
|
||||
if self.attributes is None:
|
||||
self.attributes = {}
|
||||
|
||||
|
||||
@dataclass
|
||||
class AttributeTemplate:
|
||||
"""属性模板定义"""
|
||||
@@ -68,7 +65,6 @@ class AttributeTemplate:
|
||||
if self.options is None:
|
||||
self.options = []
|
||||
|
||||
|
||||
@dataclass
|
||||
class EntityAttribute:
|
||||
"""实体属性值"""
|
||||
@@ -89,7 +85,6 @@ class EntityAttribute:
|
||||
if self.options is None:
|
||||
self.options = []
|
||||
|
||||
|
||||
@dataclass
|
||||
class AttributeHistory:
|
||||
"""属性变更历史"""
|
||||
@@ -103,7 +98,6 @@ class AttributeHistory:
|
||||
changed_at: str = ""
|
||||
change_reason: str = ""
|
||||
|
||||
|
||||
@dataclass
|
||||
class EntityMention:
|
||||
id: str
|
||||
@@ -114,7 +108,6 @@ class EntityMention:
|
||||
text_snippet: str
|
||||
confidence: float = 1.0
|
||||
|
||||
|
||||
class DatabaseManager:
|
||||
def __init__(self, db_path: str = DB_PATH):
|
||||
self.db_path = db_path
|
||||
@@ -1401,11 +1394,9 @@ class DatabaseManager:
|
||||
conn.close()
|
||||
return stats
|
||||
|
||||
|
||||
# Singleton instance
|
||||
_db_manager = None
|
||||
|
||||
|
||||
def get_db_manager() -> DatabaseManager:
|
||||
global _db_manager
|
||||
if _db_manager is None:
|
||||
|
||||
Reference in New Issue
Block a user