加入webargs验证扩展,分区用于验证的inschema和用户序列化的outschema

This commit is contained in:
mkg
2021-11-17 18:07:36 +08:00
parent fba22bbcbf
commit cdea48c7d4
21 changed files with 96 additions and 74 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ from marshmallow import fields
# 权限models序列化类
class PowerSchema(ma.Schema):
class PowerOutSchema(ma.Schema):
id = fields.Integer()
title = fields.Str(attribute="name")
type = fields.Str()
@@ -18,7 +18,7 @@ class PowerSchema(ma.Schema):
enable = fields.Integer()
class PowerSchema2(ma.Schema): # 序列化类
class PowerOutSchema2(ma.Schema): # 序列化类
powerId = fields.Str(attribute="id")
powerName = fields.Str(attribute="name")
powerType = fields.Str(attribute="type")