获取contact_count_list增加去重功能
This commit is contained in:
parent
6d502dbc04
commit
86d3a957cf
@ -137,9 +137,7 @@ qq交流群:577704006(左边二维码) or 点击链接加入群聊[pywxdum
|
|||||||
|
|
||||||
# 四、致谢
|
# 四、致谢
|
||||||
|
|
||||||
[](https://github.com/xaoyaoo/PyWxDump/graphs/contributors)
|
[](https://github.com/xaoyaoo/PyWxDump/graphs/contributors)[](https://github.com/xaoyaoo/wxdump_web/graphs/contributors)
|
||||||
|
|
||||||
[](https://github.com/xaoyaoo/wxdump_web/graphs/contributors)
|
|
||||||
|
|
||||||
# 五、许可证
|
# 五、许可证
|
||||||
|
|
||||||
|
@ -99,6 +99,8 @@ def contact_count_list():
|
|||||||
chat_count = analyzer.get_chat_count(msg_path)
|
chat_count = analyzer.get_chat_count(msg_path)
|
||||||
for contact in contact_list:
|
for contact in contact_list:
|
||||||
contact["chat_count"] = chat_count.get(contact["username"], 0)
|
contact["chat_count"] = chat_count.get(contact["username"], 0)
|
||||||
|
# 去重
|
||||||
|
contact_list = [dict(t) for t in {tuple(d.items()) for d in contact_list}]
|
||||||
# 降序
|
# 降序
|
||||||
contact_list = sorted(contact_list, key=lambda x: x["chat_count"], reverse=True)
|
contact_list = sorted(contact_list, key=lambda x: x["chat_count"], reverse=True)
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
|
||||||
def ReJson(code: int, body: dict = None, msg: str = None, error: str = None, extra: dict = None) -> dict:
|
def ReJson(code: int, body: [dict, list] = None, msg: str = None, error: str = None, extra: dict = None) -> dict:
|
||||||
"""
|
"""
|
||||||
返回格式化的json数据
|
返回格式化的json数据
|
||||||
:param code: 状态码 int
|
:param code: 状态码 int
|
||||||
|
Loading…
Reference in New Issue
Block a user