From f18adf15ea1689b2e4f6bbac84dbd49586fe2510 Mon Sep 17 00:00:00 2001 From: huangzhuang_3rd Date: Wed, 12 Aug 2026 13:30:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20AI=20Worker=20=E5=B9=B3=E5=8F=B0=20MVP?= =?UTF-8?q?=20v1.0.0=20-=20=E5=A4=9A=E7=A7=9F=E6=88=B7/=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=AE=A1=E7=90=86/AI=20Worker/=E4=BB=BB=E5=8A=A1=E7=BC=96?= =?UTF-8?q?=E6=8E=92/HITL=E5=AE=A1=E6=A0=B8/=E6=88=90=E6=9C=AC=E6=B2=BB?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/schemas/user.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 backend/app/schemas/user.py diff --git a/backend/app/schemas/user.py b/backend/app/schemas/user.py new file mode 100644 index 0000000..0a9893c --- /dev/null +++ b/backend/app/schemas/user.py @@ -0,0 +1,37 @@ +"""User schemas.""" +from pydantic import BaseModel, EmailStr, Field +from typing import Optional +from datetime import datetime + + +class UserCreate(BaseModel): + email: EmailStr + username: str = Field(..., min_length=2, max_length=100) + password: str = Field(..., min_length=6) + role: str = "worker" + user_type: str = "human" + phone: Optional[str] = None + + +class UserUpdate(BaseModel): + username: Optional[str] = None + role: Optional[str] = None + is_active: Optional[bool] = None + phone: Optional[str] = None + avatar: Optional[str] = None + + +class UserResponse(BaseModel): + id: int + email: str + username: str + role: str + user_type: str + tenant_id: int + is_active: bool + avatar: Optional[str] = None + phone: Optional[str] = None + worker_id: Optional[int] = None + created_at: datetime + + model_config = {"from_attributes": True}