feat(link_codes): linking method between telegram and website

This commit is contained in:
2026-08-18 21:10:57 +07:00
parent 7ae3c98585
commit 771d44d34c
12 changed files with 247 additions and 9 deletions

20
schemas/link_codes.py Normal file
View File

@@ -0,0 +1,20 @@
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()