修改区域数据表
This commit is contained in:
parent
86ad9448e1
commit
71e5249028
|
@ -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}
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue