end_with.py 539 B

12345678910111213141516171819202122
  1. # coding=utf-8
  2. """
  3. @project: MaxKB
  4. @Author:虎虎
  5. @file: start_with.py
  6. @date:2025/10/20 10:37
  7. @desc:
  8. """
  9. from typing import List
  10. from application.flow.compare import Compare
  11. class EndWithCompare(Compare):
  12. def support(self, node_id, fields: List[str], source_value, compare, target_value):
  13. if compare == 'end_with':
  14. return True
  15. def compare(self, source_value, compare, target_value):
  16. source_value = str(source_value)
  17. return source_value.endswith(str(target_value))