refactor: rename snapshot types to PublicChatSnapshot prefix

This commit is contained in:
CREDO23 2026-02-02 16:05:23 +02:00
parent e62e4faaa5
commit d890c562d4
9 changed files with 95 additions and 91 deletions

View file

@ -45,9 +45,9 @@ from app.schemas.new_chat import (
NewChatThreadUpdate,
NewChatThreadVisibilityUpdate,
NewChatThreadWithMessages,
PublicChatSnapshotCreateResponse,
PublicChatSnapshotListResponse,
RegenerateRequest,
SnapshotCreateResponse,
SnapshotListResponse,
ThreadHistoryLoadResponse,
ThreadListItem,
ThreadListResponse,
@ -736,7 +736,7 @@ async def update_thread_visibility(
# =============================================================================
@router.post("/threads/{thread_id}/snapshots", response_model=SnapshotCreateResponse)
@router.post("/threads/{thread_id}/snapshots", response_model=PublicChatSnapshotCreateResponse)
async def create_thread_snapshot(
thread_id: int,
session: AsyncSession = Depends(get_async_session),
@ -756,7 +756,7 @@ async def create_thread_snapshot(
)
@router.get("/threads/{thread_id}/snapshots", response_model=SnapshotListResponse)
@router.get("/threads/{thread_id}/snapshots", response_model=PublicChatSnapshotListResponse)
async def list_thread_snapshots(
thread_id: int,
session: AsyncSession = Depends(get_async_session),
@ -769,7 +769,7 @@ async def list_thread_snapshots(
"""
from app.services.public_chat_service import list_snapshots_for_thread
return SnapshotListResponse(
return PublicChatSnapshotListResponse(
snapshots=await list_snapshots_for_thread(
session=session,
thread_id=thread_id,

View file

@ -514,7 +514,7 @@ async def list_search_space_snapshots(
Requires PUBLIC_SHARING_VIEW permission.
"""
from app.schemas.new_chat import SearchSpaceSnapshotListResponse
from app.schemas.new_chat import PublicChatSnapshotsBySpaceResponse
from app.services.public_chat_service import list_snapshots_for_search_space
snapshots = await list_snapshots_for_search_space(
@ -522,4 +522,4 @@ async def list_search_space_snapshots(
search_space_id=search_space_id,
user=user,
)
return SearchSpaceSnapshotListResponse(snapshots=snapshots)
return PublicChatSnapshotsBySpaceResponse(snapshots=snapshots)

View file

@ -211,17 +211,17 @@ class RegenerateRequest(BaseModel):
# =============================================================================
class SnapshotCreateResponse(BaseModel):
"""Response after creating a public snapshot."""
class PublicChatSnapshotCreateResponse(BaseModel):
"""Response after creating a public chat snapshot."""
snapshot_id: int
share_token: str
public_url: str
is_new: bool # False if existing snapshot returned (same content)
is_new: bool
class SnapshotInfo(BaseModel):
"""Info about a single snapshot."""
class PublicChatSnapshotInfo(BaseModel):
"""Info about a single public chat snapshot."""
id: int
share_token: str
@ -230,14 +230,14 @@ class SnapshotInfo(BaseModel):
message_count: int
class SnapshotListResponse(BaseModel):
"""List of snapshots for a thread."""
class PublicChatSnapshotListResponse(BaseModel):
"""List of public chat snapshots for a thread."""
snapshots: list[SnapshotInfo]
snapshots: list[PublicChatSnapshotInfo]
class SearchSpaceSnapshotInfo(BaseModel):
"""Snapshot info with thread context for search space listing."""
class PublicChatSnapshotDetail(BaseModel):
"""Public chat snapshot with thread context."""
id: int
share_token: str
@ -248,10 +248,10 @@ class SearchSpaceSnapshotInfo(BaseModel):
thread_title: str
class SearchSpaceSnapshotListResponse(BaseModel):
"""List of all snapshots in a search space."""
class PublicChatSnapshotsBySpaceResponse(BaseModel):
"""List of public chat snapshots for a search space."""
snapshots: list[SearchSpaceSnapshotInfo]
snapshots: list[PublicChatSnapshotDetail]
# =============================================================================