使用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
@@ -0,0 +1,15 @@
from flask_restful import fields
power_fields = {
'powerId': fields.String(attribute="id"),
'powerName': fields.String(attribute="name"),
'powerType': fields.String(attribute="type"),
'powerUrl': fields.String(attribute="url"),
'openType': fields.String(attribute="open_type"),
'parentId': fields.String(attribute="parent_id"),
'icon': fields.String,
'sort': fields.Integer,
'create_time': fields.DateTime,
'update_time': fields.DateTime,
'enable': fields.Integer,
}