chenchaoyun Qwen-Coder commited on
Commit ·
4de5841
1
Parent(s): 14214ee
feat: 飞书通知地区字段格式化为 代码(国家名)
Browse filesCo-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- api_routes.py +4 -0
api_routes.py
CHANGED
|
@@ -1703,6 +1703,10 @@ async def send_feishu_notification(
|
|
| 1703 |
for key, label in header_mapping.items():
|
| 1704 |
val = device_info.get(key)
|
| 1705 |
if val:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1706 |
text_lines.append(f"{label}:{val}")
|
| 1707 |
|
| 1708 |
# 处理自定义 payload
|
|
|
|
| 1703 |
for key, label in header_mapping.items():
|
| 1704 |
val = device_info.get(key)
|
| 1705 |
if val:
|
| 1706 |
+
if key == "region":
|
| 1707 |
+
country_name = get_country_name_by_region_code(val)
|
| 1708 |
+
if country_name and country_name != val:
|
| 1709 |
+
val = f"{val}({country_name})"
|
| 1710 |
text_lines.append(f"{label}:{val}")
|
| 1711 |
|
| 1712 |
# 处理自定义 payload
|