feat: 添加版本信息缓存机制

This commit is contained in:
DLmaster361
2025-09-13 10:35:36 +08:00
parent fbd7fa6a00
commit 642b34eca3
3 changed files with 25 additions and 4 deletions

View File

@@ -134,6 +134,21 @@ class DateTimeValidator(ConfigValidator):
return "2000-01-01 00:00:00"
class JSONValidator(ConfigValidator):
def validate(self, value: Any) -> bool:
if not isinstance(value, str):
return False
try:
json.loads(value)
return True
except json.JSONDecodeError:
return False
def correct(self, value: Any) -> str:
return value if self.validate(value) else "{ }"
class EncryptValidator(ConfigValidator):
"""加密数据验证器"""