feat: Enhance idea retrieval to include the latest generation and support user-specific ideas not tied to a project, while also improving asset storage uniqueness and adjusting generation cancellation timeout.

This commit is contained in:
xds
2026-02-16 16:35:26 +03:00
parent 5e7dc19bf3
commit 68a3f529cb
15 changed files with 67 additions and 30 deletions

View File

@@ -7,14 +7,14 @@ class IdeaService:
def __init__(self, dao: DAO):
self.dao = dao
async def create_idea(self, name: str, description: Optional[str], project_id: str, user_id: str) -> Idea:
async def create_idea(self, name: str, description: Optional[str], project_id: Optional[str], user_id: str) -> Idea:
idea = Idea(name=name, description=description, project_id=project_id, created_by=user_id)
idea_id = await self.dao.ideas.create_idea(idea)
idea.id = idea_id
return idea
async def get_ideas(self, project_id: str, limit: int = 20, offset: int = 0) -> List[Idea]:
return await self.dao.ideas.get_ideas(project_id, limit, offset)
async def get_ideas(self, project_id: Optional[str], user_id: str, limit: int = 20, offset: int = 0) -> List[dict]:
return await self.dao.ideas.get_ideas(project_id, user_id, limit, offset)
async def get_idea(self, idea_id: str) -> Optional[Idea]:
return await self.dao.ideas.get_idea(idea_id)