kin: BATON-002 [Research] UX Designer
This commit is contained in:
commit
057e500d5f
29 changed files with 3530 additions and 0 deletions
31
backend/models.py
Normal file
31
backend/models.py
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class RegisterRequest(BaseModel):
|
||||
uuid: str = Field(..., min_length=1)
|
||||
name: str = Field(..., min_length=1, max_length=100)
|
||||
|
||||
|
||||
class RegisterResponse(BaseModel):
|
||||
user_id: int
|
||||
uuid: str
|
||||
|
||||
|
||||
class GeoData(BaseModel):
|
||||
lat: float = Field(..., ge=-90.0, le=90.0)
|
||||
lon: float = Field(..., ge=-180.0, le=180.0)
|
||||
accuracy: float = Field(..., gt=0)
|
||||
|
||||
|
||||
class SignalRequest(BaseModel):
|
||||
user_id: str = Field(..., min_length=1)
|
||||
timestamp: int = Field(..., gt=0)
|
||||
geo: Optional[GeoData] = None
|
||||
|
||||
|
||||
class SignalResponse(BaseModel):
|
||||
status: str
|
||||
signal_id: int
|
||||
Loading…
Add table
Add a link
Reference in a new issue