Initial commit: Audio Dashboard Management System

Made-with: Cursor
This commit is contained in:
yangy
2026-03-04 18:17:34 +08:00
commit 75b1d16453
39 changed files with 3771 additions and 0 deletions
+54
View File
@@ -0,0 +1,54 @@
from pydantic import BaseModel, Field
from typing import Optional
from datetime import datetime
# Brand Schemas
class BrandBase(BaseModel):
name: str = Field(..., min_length=1, max_length=100, description="品牌名称")
class BrandCreate(BrandBase):
pass
class BrandUpdate(BaseModel):
name: Optional[str] = Field(None, min_length=1, max_length=100, description="品牌名称")
class BrandResponse(BrandBase):
id: int
class Config:
from_attributes = True
# Model Schemas
class ModelBase(BaseModel):
brand_name: str = Field(..., min_length=1, max_length=100, description="品牌名称")
name: str = Field(..., min_length=1, max_length=100, description="型号名称")
form: Optional[str] = Field(None, max_length=100, description="形式")
rig: Optional[str] = Field(None, max_length=100, description="阻抗")
source: Optional[str] = Field(None, max_length=100, description="来源")
eq_key: Optional[str] = Field(None, max_length=255, description="EQ 键")
class ModelCreate(ModelBase):
pass
class ModelUpdate(BaseModel):
brand_name: Optional[str] = Field(None, min_length=1, max_length=100, description="品牌名称")
name: Optional[str] = Field(None, min_length=1, max_length=100, description="型号名称")
form: Optional[str] = Field(None, max_length=100, description="形式")
rig: Optional[str] = Field(None, max_length=100, description="阻抗")
source: Optional[str] = Field(None, max_length=100, description="来源")
eq_key: Optional[str] = Field(None, max_length=255, description="EQ 键")
class ModelResponse(ModelBase):
id: int
create_at: datetime
class Config:
from_attributes = True