first commit
This commit is contained in:
16
api/v1/deps.py
Normal file
16
api/v1/deps.py
Normal file
@@ -0,0 +1,16 @@
|
||||
"""API v1 依赖模块
|
||||
|
||||
提供路由可复用的依赖函数,例如获取数据库管理器。
|
||||
"""
|
||||
|
||||
from typing import Generator
|
||||
from database_manager import db_manager, DatabaseManager
|
||||
|
||||
def get_db_manager() -> DatabaseManager:
|
||||
"""获取全局数据库管理器实例
|
||||
|
||||
Returns:
|
||||
DatabaseManager: 全局的数据库管理器,用于创建/管理连接与执行SQL。
|
||||
"""
|
||||
return db_manager
|
||||
|
||||
Reference in New Issue
Block a user