From fee04594a2cc442501175e373c0d23f8d92caed8 Mon Sep 17 00:00:00 2001 From: qsc Date: Fri, 30 Jan 2026 22:52:59 +0800 Subject: [PATCH] 11 --- core/jx3_data.py | 76 ++++++++++++++++++++++++++++++++++++++++++-- data/api_config.json | 14 ++++++++ 2 files changed, 88 insertions(+), 2 deletions(-) diff --git a/core/jx3_data.py b/core/jx3_data.py index 4d0b8cc..446334b 100644 --- a/core/jx3_data.py +++ b/core/jx3_data.py @@ -159,7 +159,7 @@ class JX3Service: return return_data return_data["code"] = 200 - + return return_data async def richangyuche(self) -> Dict[str, Any]: @@ -1383,4 +1383,76 @@ class JX3Service: return_data["code"] = 200 - return return_data \ No newline at end of file + return return_data + + + async def peizhuang(self, name: str = "易筋经") -> Dict[str, Any]: + """配装""" + return_data = self._init_return_data() + + name_map = { + "冰心诀":10081, + "云裳心经":10080, + "花间游":10021, + "离经易道":10028, + "冰心诀":10081, + "冰心诀":10081, + "冰心诀":10081, + "冰心诀":10081, + "冰心诀":10081, + "冰心诀":10081, + "冰心诀":10081, + "冰心诀":10081, + "冰心诀":10081, + "冰心诀":10081, + "冰心诀":10081, + "冰心诀":10081, + "冰心诀":10081, + "冰心诀":10081, + "冰心诀":10081, + "冰心诀":10081, + "冰心诀":10081, + "冰心诀":10081, + "冰心诀":10081, + "冰心诀":10081, + "冰心诀":10081, + "冰心诀":10081, + "冰心诀":10081, + "冰心诀":10081, + "冰心诀":10081, + "冰心诀":10081, + "冰心诀":10081 + } + + # 1. 构造请求参数 + params = {"per": "10","page": "1","tags": "","client": "20","global_level": "130","mount": "","star": "1"} + + # 2. 调用基础请求 + data: Optional[Dict[str, Any]] = await self._base_request( + "jx3_bagua", "GET", params=params + ) + + # 3. 处理返回数据 + try: + if not data: + result_msg = f"未找到相关 {type} 记录。\n" + result_msg += f"可选范围:818 616 鬼网三 鬼网3 树洞 记录 教程 街拍 故事 避雷 吐槽 提问" + else: + result_msg = f"类型:{type} 的最新记录如下:\n\n" + + for item in data: + result_msg += f"{item['title']}\n" + result_msg += f"分区:{item['zone']} 服务器:{item['server']}\n" + result_msg += f"所属吧:{item['name']}\n" + result_msg += f"链接:https://tieba.baidu.com/p/{item['url']}\n" + result_msg += f"日期:{item['date']}\n\n" + return_data["data"] = result_msg + except Exception as e: + logger.exception("处理返回数据失败") + return_data["msg"] = "处理返回数据失败" + return return_data + + return_data["code"] = 200 + + return return_data + \ No newline at end of file diff --git a/data/api_config.json b/data/api_config.json index 9dd8ec8..b599e4b 100644 --- a/data/api_config.json +++ b/data/api_config.json @@ -307,5 +307,19 @@ "size": "20", "client": "std" } + }, + "jx3box_peizhuang":{ + "url":"https://cms.jx3box.com/api/cms/app/pz", + "method":"GET", + "description":"魔盒获取宏配置列表", + "params":{ + "per": "10", + "page": "1", + "tags": "", + "client": "20", + "global_level": "130", + "mount": "", + "star": "1" + } } } \ No newline at end of file