refactor: 预留并行修复所需的共享接口

This commit is contained in:
2026-10-25 06:48:26 +08:00
parent d96f430a7d
commit 6b84a5e406
10 changed files with 179 additions and 42 deletions
+11
View File
@@ -0,0 +1,11 @@
def normalize_id(value) -> str:
if value is None:
return ""
text = str(value).strip().strip("\ufeff")
text = text.translate(str.maketrans("0123456789", "0123456789"))
text = "".join(text.split())
if text.endswith(".0") and text[:-2].isdigit():
text = text[:-2]
if not text or not text.isdigit():
return ""
return text