```
feat: 添加飞书用户模块和订阅功能支持 - 新增feishu_users模块用于处理飞书用户身份验证和权限管理 - 新增subscriptions模块用于处理订阅相关功能 - 新增personalization模块用于个性化服务 - 在alembic迁移配置中注册新的模型模块 - 在API路由器中添加feishu_users和subscriptions路由 - 实现事件调度服务的改进,包括错误处理和状态更新优化 - 添加飞书命令处理的权限检查机制 - 实现飞书应用票据事件处理 - 改进审计日志记录功能 ```
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
from app.core.database import Base, engine
|
||||
from pathlib import Path
|
||||
|
||||
from alembic import command
|
||||
from alembic.config import Config
|
||||
|
||||
from app.modules.ai_memory.models import AIMemoryEntry
|
||||
from app.modules.audit.models import AuditLog
|
||||
from app.modules.business.models import (
|
||||
@@ -31,14 +35,27 @@ from app.modules.business.models import (
|
||||
WorkTask,
|
||||
)
|
||||
from app.modules.feishu.models import FeishuEventReceipt
|
||||
from app.modules.feishu_users.models import (
|
||||
FeishuAdminBootstrapTombstone,
|
||||
FeishuUser,
|
||||
)
|
||||
from app.modules.events.models import DomainEvent
|
||||
from app.modules.observability.models import SystemHeartbeat
|
||||
from app.modules.personalization.models import (
|
||||
AIConversation,
|
||||
AIConversationMessage,
|
||||
PersonalDataErasureRequest,
|
||||
UserPreference,
|
||||
)
|
||||
from app.modules.subscriptions.models import PushDelivery, PushSubscription
|
||||
from app.modules.workflows.models import WorkflowAction, WorkflowInstance
|
||||
|
||||
_MODELS = [
|
||||
AuditLog,
|
||||
Employee,
|
||||
FeishuEventReceipt,
|
||||
FeishuUser,
|
||||
FeishuAdminBootstrapTombstone,
|
||||
Project,
|
||||
ProjectCashFlow,
|
||||
ProjectContract,
|
||||
@@ -68,14 +85,23 @@ _MODELS = [
|
||||
WorkflowInstance,
|
||||
WorkflowAction,
|
||||
AIMemoryEntry,
|
||||
UserPreference,
|
||||
AIConversation,
|
||||
AIConversationMessage,
|
||||
PersonalDataErasureRequest,
|
||||
PushSubscription,
|
||||
PushDelivery,
|
||||
SystemHeartbeat,
|
||||
SourceSyncCursor,
|
||||
]
|
||||
|
||||
|
||||
def main() -> None:
|
||||
Base.metadata.create_all(bind=engine)
|
||||
print("Database schema initialized.")
|
||||
project_root = Path(__file__).resolve().parents[2]
|
||||
config = Config(str(project_root / "alembic.ini"))
|
||||
config.set_main_option("script_location", str(project_root / "alembic"))
|
||||
command.upgrade(config, "head")
|
||||
print("Database schema migrated to Alembic head.")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user