使用flask-restful实现数据校验与序列化

This commit is contained in:
zhengxinonly
2021-06-26 03:17:29 +08:00
parent 8fba71c464
commit b8870d4c33
27 changed files with 273 additions and 533 deletions
-12
View File
@@ -37,15 +37,3 @@ class PowerSchema(ma.Schema):
enable = fields.Integer()
class PowerSchema2(ma.Schema): # 序列化类
powerId = fields.Str(attribute="id")
powerName = fields.Str(attribute="name")
powerType = fields.Str(attribute="type")
powerUrl = fields.Str(attribute="url")
openType = fields.Str(attribute="open_type")
parentId = fields.Str(attribute="parent_id")
icon = fields.Str()
sort = fields.Integer()
create_time = fields.DateTime()
update_time = fields.DateTime()
enable = fields.Integer()