27 lines
598 B
Python
27 lines
598 B
Python
from __future__ import annotations
|
|
|
|
from typing import Literal
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
LinkType = Literal["extend", "traffic"]
|
|
|
|
|
|
class GuestLinkCreate(BaseModel):
|
|
link_type: LinkType
|
|
title: str = Field(default="", max_length=120)
|
|
value: int = Field(ge=1, le=100000)
|
|
max_uses: int = Field(default=1, ge=1, le=100000)
|
|
expires_at: str | None = None
|
|
note: str = Field(default="", max_length=500)
|
|
|
|
|
|
class GuestClaimRequest(BaseModel):
|
|
identifier: str = Field(min_length=1, max_length=128)
|
|
|
|
|
|
class LoginRequest(BaseModel):
|
|
username: str
|
|
password: str
|