修改区域数据表

This commit is contained in:
wcq 2023-03-22 10:54:28 +08:00
parent 86ad9448e1
commit 71e5249028
2 changed files with 10 additions and 9 deletions

View File

@ -9,9 +9,9 @@ class AreaIndexMain(common_db.Base):
"""
__tablename__ = "area_index_main"
area_id = Column(Integer, primary_key=True, comment="区域code")
province = Column(String(128), comment="")
city = Column(String(128), comment="")
district = Column(String(128), comment="")
type = Column(String(128), comment="区域类型")
name = Column(String(128), comment="名称")
belong = Column(Integer, comment="上级")
def to_dict(self):
data = {c.name: getattr(self, c.name) for c in self.__table__.columns}

View File

@ -5,15 +5,16 @@ from typing import Optional, List
class AreaIndexMainInfo(BaseModel):
area_id: Optional[int]
province: Optional[str]
city: Optional[str]
district: Optional[str]
type: Optional[str]
name: Optional[str]
belong: Optional[int]
class AreaIndexMainAddInfo(BaseModel):
province: str
city: str
district: str
area_id: int
type: str
name: str
belong: Optional[int]
class AreaIndexMainAddReq(AreaIndexMainAddInfo):