21 lines
414 B
Python
21 lines
414 B
Python
from datetime import datetime
|
|
|
|
from pydantic import BaseModel, Field, computed_field
|
|
|
|
from config import cfg
|
|
|
|
|
|
class LinkCodeResponse(BaseModel):
|
|
code: str = Field()
|
|
expires_at: datetime = Field()
|
|
|
|
@computed_field
|
|
@property
|
|
def deep_link(self) -> str:
|
|
return cfg.bot_url + "?start=" + self.code
|
|
|
|
|
|
class LinkCodeConsume(BaseModel):
|
|
code: str = Field()
|
|
telegram_id: int = Field()
|