refactor(memory): simplify config retrieval and remove redundant functions
- Remove get_memory_config_id function from end_user_repository.py as it's no longer needed - Remove get_end_user_memory_config_id function from memory_agent_service.py to reduce duplication - Simplify get_end_user_connected_config to use MemoryConfigService.get_config_with_fallback - Update get_config_with_fallback signature to accept memory_config_id directly instead of end_user_id - Remove unnecessary AppRelease query and config parsing logic from get_end_user_connected_config - Streamline memory config retrieval flow to use service layer abstraction - Improves code maintainability by centralizing config fallback logic in MemoryConfigService
This commit is contained in:
@@ -503,17 +503,3 @@ def update_memory_config_id(db: Session, end_user_id: uuid.UUID, memory_config_i
|
||||
"""
|
||||
repo = EndUserRepository(db)
|
||||
return repo.update_memory_config_id(end_user_id, memory_config_id)
|
||||
|
||||
|
||||
def get_memory_config_id(db: Session, end_user_id: uuid.UUID) -> Optional[uuid.UUID]:
|
||||
"""获取终端用户的 memory_config_id。
|
||||
|
||||
Args:
|
||||
db: 数据库会话
|
||||
end_user_id: 终端用户ID
|
||||
|
||||
Returns:
|
||||
Optional[uuid.UUID]: memory_config_id 或 None
|
||||
"""
|
||||
repo = EndUserRepository(db)
|
||||
return repo.get_memory_config_id(end_user_id)
|
||||
|
||||
Reference in New Issue
Block a user