forked from mtusi2026/mtusi2026lab2
chore: carry over lab 1 solution into lab 2 skeleton
Copy the committed lab 1 sources as-is: src/, student-tests/, bench/, Dockerfile, docker-compose.yml, pyproject.toml, uv.lock, .python-version, config_example.toml, AGENTS.md, CLAUDE.md, .claude/, openspec/, .graphifyignore and KNOWN_ISSUES.md. Lab 1 evidence stays in the lab 1 repository. Merge the new skeleton files with own sections: Makefile (lab 2 targets plus own run, docker, bench and common targets), .gitignore, .dockerignore and .env.example. Rename the image to mtusi-messenger:lab2 and point AGENTS.md at lab 2. The application is still the in-memory lab 1 implementation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
from .chat import ChatFullDTO, ChatPageDTO
|
||||
from .message import MessageFullDTO, MessagePageDTO
|
||||
from .user import UserFullDTO
|
||||
|
||||
__all__ = [
|
||||
"ChatFullDTO",
|
||||
"ChatPageDTO",
|
||||
"MessageFullDTO",
|
||||
"MessagePageDTO",
|
||||
"UserFullDTO",
|
||||
]
|
||||
@@ -0,0 +1,20 @@
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime
|
||||
from uuid import UUID
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class ChatFullDTO:
|
||||
id: UUID
|
||||
title: str
|
||||
# в порядке, переданном при создании
|
||||
member_ids: tuple[UUID, ...]
|
||||
created_at: datetime
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class ChatPageDTO:
|
||||
"""Страница списка чатов пользователя."""
|
||||
|
||||
items: tuple[ChatFullDTO, ...]
|
||||
next_cursor: str | None
|
||||
@@ -0,0 +1,20 @@
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime
|
||||
from uuid import UUID
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class MessageFullDTO:
|
||||
id: UUID
|
||||
chat_id: UUID
|
||||
sender_id: UUID
|
||||
text: str
|
||||
created_at: datetime
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class MessagePageDTO:
|
||||
"""Страница истории чата."""
|
||||
|
||||
items: tuple[MessageFullDTO, ...]
|
||||
next_cursor: str | None
|
||||
@@ -0,0 +1,11 @@
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime
|
||||
from uuid import UUID
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class UserFullDTO:
|
||||
id: UUID
|
||||
username: str
|
||||
display_name: str
|
||||
created_at: datetime
|
||||
@@ -0,0 +1,5 @@
|
||||
from .settings import RunModeEnum
|
||||
|
||||
__all__ = [
|
||||
"RunModeEnum",
|
||||
]
|
||||
@@ -0,0 +1,8 @@
|
||||
from enum import StrEnum
|
||||
|
||||
|
||||
class RunModeEnum(StrEnum):
|
||||
"""Режим запуска: console — на хосте, docker — в контейнере."""
|
||||
|
||||
CONSOLE = "console"
|
||||
DOCKER = "docker"
|
||||
Reference in New Issue
Block a user