dataset_domain.py 525 B

1234567891011121314151617181920212223
  1. from flask_marshmallow import Marshmallow
  2. from marshmallow import fields, post_load
  3. ma = Marshmallow()
  4. class ExtractLabelResp:
  5. """
  6. 提取密码标签响应体
  7. """
  8. def __init__(self, code, msg, label):
  9. self.code = code
  10. self.msg = msg
  11. self.label = label
  12. class ExtractLabelRespSchema(ma.Schema):
  13. code = fields.Integer()
  14. msg = fields.String()
  15. label = fields.String()
  16. @post_load
  17. def make_label_resp(self, object, **kwargs):
  18. return ExtractLabelResp(**object)