base_label.py 702 B

12345678910111213141516171819202122232425262728
  1. # coding=utf-8
  2. """
  3. @project: MaxKB
  4. @Author:虎
  5. @file: base_label.py
  6. @date:2024/8/22 17:11
  7. @desc:
  8. """
  9. class BaseLabel:
  10. def __init__(self,
  11. input_type: str,
  12. label: str,
  13. attrs=None,
  14. props_info=None):
  15. self.input_type = input_type
  16. self.label = label
  17. self.attrs = attrs
  18. self.props_info = props_info
  19. def to_dict(self, **kwargs):
  20. return {
  21. 'input_type': self.input_type,
  22. 'label': self.label,
  23. 'attrs': {} if self.attrs is None else self.attrs,
  24. 'props_info': {} if self.props_info is None else self.props_info,
  25. }