login passwd

This commit is contained in:
2026-04-25 19:54:39 +02:00
parent 8cd28873e8
commit 4e26248dc8
10 changed files with 277 additions and 6 deletions

View File

@@ -18,6 +18,27 @@ class StudentRead(BaseModel):
from_attributes = True
class UserRead(BaseModel):
id: int
username: str
role: str
student_id: int | None = None
class Config:
from_attributes = True
class LoginRequest(BaseModel):
username: str = Field(..., min_length=1)
password: str = Field(..., min_length=1)
class LoginResponse(BaseModel):
access_token: str
token_type: str = "bearer"
user: UserRead
class ChatRequest(BaseModel):
student_id: int
message: str