address增加楼栋字段
This commit is contained in:
parent
fd8e55e91a
commit
79d898ea97
@ -11,6 +11,8 @@ class AddressDB(Base):
|
|||||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||||
user_id = Column(Integer, ForeignKey("users.userid"), index=True)
|
user_id = Column(Integer, ForeignKey("users.userid"), index=True)
|
||||||
community_id = Column(Integer, index=True)
|
community_id = Column(Integer, index=True)
|
||||||
|
community_building_id = Column(Integer, ForeignKey("community_buildings.id"), nullable=True)
|
||||||
|
community_building_name = Column(String(100), nullable=True)
|
||||||
address_detail = Column(String(200))
|
address_detail = Column(String(200))
|
||||||
name = Column(String(50))
|
name = Column(String(50))
|
||||||
phone = Column(String(11))
|
phone = Column(String(11))
|
||||||
@ -21,6 +23,8 @@ class AddressDB(Base):
|
|||||||
# Pydantic 模型
|
# Pydantic 模型
|
||||||
class AddressCreate(BaseModel):
|
class AddressCreate(BaseModel):
|
||||||
community_id: int
|
community_id: int
|
||||||
|
community_building_id: Optional[int] = None
|
||||||
|
community_building_name: Optional[str] = Field(None, max_length=100)
|
||||||
address_detail: str = Field(..., max_length=200)
|
address_detail: str = Field(..., max_length=200)
|
||||||
name: str = Field(..., max_length=50)
|
name: str = Field(..., max_length=50)
|
||||||
phone: str = Field(..., pattern="^1[3-9]\d{9}$")
|
phone: str = Field(..., pattern="^1[3-9]\d{9}$")
|
||||||
@ -28,6 +32,8 @@ class AddressCreate(BaseModel):
|
|||||||
|
|
||||||
class AddressUpdate(BaseModel):
|
class AddressUpdate(BaseModel):
|
||||||
community_id: Optional[int] = None
|
community_id: Optional[int] = None
|
||||||
|
community_building_id: Optional[int] = None
|
||||||
|
community_building_name: Optional[str] = Field(None, max_length=100)
|
||||||
address_detail: Optional[str] = Field(None, max_length=200)
|
address_detail: Optional[str] = Field(None, max_length=200)
|
||||||
name: Optional[str] = Field(None, max_length=50)
|
name: Optional[str] = Field(None, max_length=50)
|
||||||
phone: Optional[str] = Field(None, pattern="^1[3-9]\d{9}$")
|
phone: Optional[str] = Field(None, pattern="^1[3-9]\d{9}$")
|
||||||
@ -36,6 +42,8 @@ class AddressUpdate(BaseModel):
|
|||||||
class AddressInfo(BaseModel):
|
class AddressInfo(BaseModel):
|
||||||
id: int
|
id: int
|
||||||
community_id: int
|
community_id: int
|
||||||
|
community_building_id: Optional[int]
|
||||||
|
community_building_name: Optional[str]
|
||||||
address_detail: str
|
address_detail: str
|
||||||
name: str
|
name: str
|
||||||
phone: str
|
phone: str
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user