diff --git a/Model/PostModel.py b/Model/PostModel.py index e7a7139..9c990e3 100644 --- a/Model/PostModel.py +++ b/Model/PostModel.py @@ -6,7 +6,6 @@ class Post(Base): __tablename__ = "POST_TABLE" id = Column(Integer, primary_key=True, comment="职务id") name = Column(String(32), comment="职务名称") - default_auth = Column(Text, comment="职务默认权限") def to_dict(self): return {c.name: getattr(self, c.name) for c in self.__table__.columns} diff --git a/Router/PostRouter.py b/Router/PostRouter.py index 2cd7584..a10dc15 100644 --- a/Router/PostRouter.py +++ b/Router/PostRouter.py @@ -16,7 +16,7 @@ router = APIRouter( @router.post("/get_post_list", summary="获取职务列表", response_model=PostSchemas.PostInfoList) def get_post_list(db: Session = Depends(get_db)): post_list = PostCrud.get_post_list(db) - items = [item.as_info() for item in post_list] + items = [item.to_dict() for item in post_list] post_info_list = PostSchemas.PostInfoList(post_info_list=items) return post_info_list