feat: 后端添加version上报

This commit is contained in:
DLmaster361
2025-09-07 03:21:38 +08:00
parent 2636858fc0
commit 6bf30b4dc6
8 changed files with 199 additions and 7 deletions

View File

@@ -97,6 +97,20 @@ class UidValidator(ConfigValidator):
return value if self.validate(value) else None
class UUIDValidator(ConfigValidator):
"""UUID验证器"""
def validate(self, value: Any) -> bool:
try:
uuid.UUID(value)
return True
except (TypeError, ValueError):
return False
def correct(self, value: Any) -> Any:
return value if self.validate(value) else str(uuid.uuid4())
class EncryptValidator(ConfigValidator):
"""加数据验证器"""