diff options
| author | handingkang <[email protected]> | 2024-04-22 10:22:05 +0800 |
|---|---|---|
| committer | handingkang <[email protected]> | 2024-04-22 10:22:05 +0800 |
| commit | db8be15a5bd26f992f282f8fb8598ed09ae01070 (patch) | |
| tree | 06c7f8ade8563f14bfc8e65fed42fd0be15b3755 /server | |
| parent | a1be40004d1cdeaf5b8f6096fb569d0415fdcc41 (diff) | |
完成目标可筛选信息获取接口功能实现
Diffstat (limited to 'server')
| -rw-r--r-- | server/apps/target.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/server/apps/target.py b/server/apps/target.py index 6c4e667..98e1cb1 100644 --- a/server/apps/target.py +++ b/server/apps/target.py @@ -287,17 +287,21 @@ def target_info(query_data): "isp": List(String()), "cou": List(String()) }) -# TODO:实现 def filter_info(): proto = ["IPv6", "DNSSEC", "DoH", "DoT"] + # 查询所有的isp isp_sql = """SELECT DISTINCT ISP from %s """ % MYSQL_TAB_TARGETDATA # 执行查询 da.cursor.execute(isp_sql) isp_data = da.cursor.fetchall() - # TODO:测试 - isp = [i[0] for i in isp_data] + isp = [i.popitem()[1] for i in isp_data] - cou = ["美国", "中国", "日本", "澳大利亚", "新加坡"] + # 查询所有的国家 + cou_sql = """SELECT DISTINCT COU from %s """ % MYSQL_TAB_TARGETDATA + # 执行查询 + da.cursor.execute(cou_sql) + cou_data = da.cursor.fetchall() + cou = [i.popitem()[1] for i in cou_data] return {"code": 200, "proto": proto, "isp": isp, "cou": cou} |
