This commit is contained in:
mojunze
2026-10-20 12:53:02 +08:00
parent df431b3641
commit 23f81ef0c4
20 changed files with 34496 additions and 216 deletions
+52 -4
View File
@@ -2,7 +2,7 @@ import base64
import requests
from typing import Optional, Dict, Any, List
TIMEOUT = 15
BASE_URL = "http://47.103.6.52/openApi"
BASE_URL = "http://ktl-001.dsfdl-henan.xyz/openApi"
def _auth(username: str, password: str) -> Dict[str, str]:
token = base64.b64encode(f"{username}:{password}".encode()).decode()
return {"Authorization": f"Basic {token}"}
@@ -24,6 +24,54 @@ def get_stats(stat_date: str, # 'yyyy-MM-dd' / 'total'
USER = "thzn-datagram0001"
PWD = "thzn-datagram0001"
VENDOR = "mt-datagram"
TIME='2025-12-30'
clientid = "666"#对应客户端id的数据查询
print(get_stats(TIME,VENDOR,USER,PWD,clientid))
TIME='2026-10-19'
clientid_list = [
'福州',
'合肥',
'北京',
'重庆',
'杭州',
'兰州',
'广州',
'佛山',
'上海',
'南宁',
'贵阳',
'海口',
'石家庄',
'郑州',
'哈尔滨',
'武汉',
'长沙',
'长春',
'南京',
'南昌',
'沈阳',
'呼和浩特',
'济南',
'太原',
'西安',
'成都',
'天津',
'拉萨',
'乌鲁木齐',
'深圳',
'西宁',
'银川',
'昆明',
'福州',
'苏州',
'青岛',
'东莞',
'厦门',
'厦门',
'无锡',
'大连',
]
success,reject = 0,0
for clientid in list(set(clientid_list)):
result = get_stats(TIME,VENDOR,USER,PWD,clientid)
success+=result['success']
reject+=result['reject']
print(clientid,result)
print(f'{TIME}总成功条数: {success}, 总失败条数: {reject}')