refactor(api):移除marshal序列化

This commit is contained in:
zhengxinonly
2021-12-07 20:24:07 +08:00
parent 9490ccb7c0
commit 820ab9f5c6
13 changed files with 282 additions and 172 deletions
+4
View File
@@ -18,6 +18,10 @@ class CompanyDepartment(db.Model, BaseModel):
@staticmethod
def fields():
"""
定义模型的常用输出字段,新手请忽略。可以简化字段序列化操作,
详细操作请查看 flask-restful marshal 的用法
"""
return {
'deptId': fields.Integer(attribute="id"),
'parentId': fields.Integer(attribute="parent_id"),