This commit is contained in:
22
services/chat/src/app/schemas/chat.py
Normal file
22
services/chat/src/app/schemas/chat.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from __future__ import annotations
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from typing import Optional
|
||||
|
||||
class RoomCreate(BaseModel):
|
||||
title: Optional[str] = None
|
||||
participants: list[str] # user IDs
|
||||
|
||||
class RoomRead(BaseModel):
|
||||
id: str
|
||||
title: Optional[str] = None
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
class MessageCreate(BaseModel):
|
||||
content: str
|
||||
|
||||
class MessageRead(BaseModel):
|
||||
id: str
|
||||
room_id: str
|
||||
sender_id: str
|
||||
content: str
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
Reference in New Issue
Block a user