from flask_marshmallow import Marshmallow from marshmallow import fields, post_load ma = Marshmallow() class ExtractLabelResp: """ 提取密码标签响应体 """ def __init__(self, code, msg, label): self.code = code self.msg = msg self.label = label class ExtractLabelRespSchema(ma.Schema): code = fields.Integer() msg = fields.String() label = fields.String() @post_load def make_label_resp(self, object, **kwargs): return ExtractLabelResp(**object)