1 line
15 KiB
JSON
1 line
15 KiB
JSON
{"openapi":"3.0.2","info":{"title":"WeChatFerry HTTP 客户端","description":"Github: <a href=\"https://github.com/lich0821/WeChatFerry\">WeChatFerry</a></br><table style=\"border:0;margin-left:auto;margin-right:auto;width:600px\">\n<thead>\n<tr>\n<th style=\"text-align:center\"><img src=\"https://raw.githubusercontent.com/lich0821/WeChatFerry/master/assets/TEQuant.jpg\" alt=\"碲矿\" style=\"height:200px\"></th>\n<th style=\"text-align:center\"><img src=\"https://raw.githubusercontent.com/lich0821/WeChatFerry/master/assets/QR.jpeg\" alt=\"赞赏\" style=\"height:200px\"></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td style=\"text-align:center\">后台回复 <code>WeChatFerry</code> 加群交流</td>\n<td style=\"text-align:center\">如果你觉得有用</td>\n</tr>\n</tbody>\n</table>","version":"0.1.0"},"paths":{"/msg_cb":{"post":{"tags":["示例"],"summary":"接收消息回调样例","description":"示例回调方法,简单打印消息","operationId":"msg_cb_msg_cb_post","requestBody":{"content":{"application/json":{"schema":{"title":"Msg","allOf":[{"$ref":"#/components/schemas/Msg"}],"description":"微信消息"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/login":{"get":{"summary":"获取登录状态","description":"获取登录状态","operationId":"is_login_login_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Is Login Login Get","type":"object"}}}}}}},"/wxid":{"get":{"summary":"获取登录账号 wxid","description":"获取登录账号 wxid","operationId":"get_self_wxid_wxid_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get Self Wxid Wxid Get","type":"object"}}}}}}},"/user-info":{"get":{"summary":"获取登录账号个人信息","description":"获取登录账号个人信息","operationId":"get_user_info_user_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get User Info User Info Get","type":"object"}}}}}}},"/msg-types":{"get":{"summary":"获取消息类型","description":"获取消息类型","operationId":"get_msg_types_msg_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get Msg Types Msg Types Get","type":"object"}}}}}}},"/contacts":{"get":{"summary":"获取完整通讯录","description":"获取完整通讯录","operationId":"get_contacts_contacts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get Contacts Contacts Get","type":"object"}}}}}}},"/friends":{"get":{"summary":"获取好友列表","description":"获取好友列表","operationId":"get_friends_friends_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get Friends Friends Get","type":"object"}}}}}}},"/dbs":{"get":{"summary":"获取所有数据库","description":"获取所有数据库","operationId":"get_dbs_dbs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get Dbs Dbs Get","type":"object"}}}}}}},"/{db}/tables":{"get":{"summary":"获取 db 中所有表","description":"获取 db 中所有表\n\nArgs:\n db (str): 数据库名(可通过 `get_dbs` 查询)\n\nReturns:\n List[dict]: `db` 下的所有表名及对应建表语句","operationId":"get_tables__db__tables_get","parameters":[{"required":true,"schema":{"title":"Db","type":"string"},"name":"db","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get Tables Db Tables Get","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/text":{"post":{"summary":"发送文本消息","description":"发送文本消息,可参考:https://github.com/lich0821/WeChatRobot/blob/master/robot.py 里 sendTextMsg\n\nArgs:\n msg (str): 要发送的消息,换行使用 `\\\\n`;如果 @ 人的话,需要带上跟 `aters` 里数量相同的 @\n receiver (str): 消息接收人,wxid 或者 roomid\n aters (str): 要 @ 的 wxid,多个用逗号分隔;`@所有人` 只需要 `notify@all`\n\nReturns:\n int: 0 为成功,其他失败","operationId":"send_text_text_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_send_text_text_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Send Text Text Post","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/image":{"post":{"summary":"发送图片消息","description":"发送图片,非线程安全\n\nArgs:\n path (str): 图片路径,如:`C:/Projs/WeChatRobot/TEQuant.jpeg` 或 `https://raw.githubusercontent.com/lich0821/WeChatRobot/master/TEQuant.jpeg`\n receiver (str): 消息接收人,wxid 或者 roomid\n\nReturns:\n int: 0 为成功,其他失败","operationId":"send_image_image_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_send_image_image_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Send Image Image Post","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/file":{"post":{"summary":"发送文件消息","description":"发送文件\n\nArgs:\n path (str): 本地文件路径,如:`C:/Projs/WeChatRobot/README.MD`\n receiver (str): 消息接收人,wxid 或者 roomid\n\nReturns:\n int: 0 为成功,其他失败","operationId":"send_file_file_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_send_file_file_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Send File File Post","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sql":{"post":{"summary":"执行 SQL,如果数据量大注意分页,以免 OOM","description":"执行 SQL,如果数据量大注意分页,以免 OOM\n\nArgs:\n db (str): 要查询的数据库\n sql (str): 要执行的 SQL\n\nReturns:\n List[dict]: 查询结果","operationId":"query_sql_sql_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_query_sql_sql_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Query Sql Sql Post","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/new-friend":{"post":{"summary":"通过好友申请","description":"通过好友申请\n\nArgs:\n v3 (str): 加密用户名 (好友申请消息里 v3 开头的字符串)\n v4 (str): Ticket (好友申请消息里 v4 开头的字符串)\n scene: 申请方式 (好友申请消息里的 scene)\n\nReturns:\n int: 1 为成功,其他失败","operationId":"accept_new_friend_new_friend_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_accept_new_friend_new_friend_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Accept New Friend New Friend Post","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chatroom-member":{"post":{"summary":"添加群成员","description":"添加群成员\n\nArgs:\n roomid (str): 待加群的 id\n wxids (str): 要加到群里的 wxid,多个用逗号分隔\n\nReturns:\n int: 1 为成功,其他失败","operationId":"add_chatroom_members_chatroom_member_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_add_chatroom_members_chatroom_member_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Add Chatroom Members Chatroom Member Post","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"删除群成员","description":"删除群成员\n\nArgs:\n roomid (str): 群的 id\n wxids (str): 要删除的 wxid,多个用逗号分隔\n\nReturns:\n int: 1 为成功,其他失败","operationId":"del_chatroom_members_chatroom_member_delete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_del_chatroom_members_chatroom_member_delete"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Del Chatroom Members Chatroom Member Delete","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/transfer":{"post":{"summary":"接收转账","description":"接收转账\n\nArgs:\n wxid (str): 转账消息里的发送人 wxid\n transferid (str): 转账消息里的 transferid\n transactionid (str): 转账消息里的 transactionid\n\nReturns:\n int: 1 为成功,其他失败","operationId":"receive_transfer_transfer_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_receive_transfer_transfer_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Receive Transfer Transfer Post","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dec-image":{"post":{"summary":"解密图片","description":"解密图片:\n\nArgs:\n src (str): 加密的图片路径\n dst (str): 解密的图片路径\n\nReturns:\n bool: 是否成功","operationId":"decrypt_image_dec_image_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_decrypt_image_dec_image_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Decrypt Image Dec Image Post","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_accept_new_friend_new_friend_post":{"title":"Body_accept_new_friend_new_friend_post","type":"object","properties":{"v3":{"title":"V3","type":"string","description":"加密用户名 (好友申请消息里 v3 开头的字符串)","default":"v3"},"v4":{"title":"V4","type":"string","description":"Ticket (好友申请消息里 v4 开头的字符串)","default":"v4"},"scene":{"title":"Scene","type":"integer","description":"申请方式 (好友申请消息里的 scene)","default":30}}},"Body_add_chatroom_members_chatroom_member_post":{"title":"Body_add_chatroom_members_chatroom_member_post","type":"object","properties":{"roomid":{"title":"Roomid","type":"string","description":"待加群的 id","default":"xxxxxxxx@chatroom"},"wxids":{"title":"Wxids","type":"string","description":"要加到群里的 wxid,多个用逗号分隔","default":"wxid_xxxxxxxxxxxxx"}}},"Body_decrypt_image_dec_image_post":{"title":"Body_decrypt_image_dec_image_post","type":"object","properties":{"src":{"title":"Src","type":"string","description":"加密的图片路径,从图片消息中获取","default":"C:\\..."},"dst":{"title":"Dst","type":"string","description":"解密的图片路径","default":"C:\\..."}}},"Body_del_chatroom_members_chatroom_member_delete":{"title":"Body_del_chatroom_members_chatroom_member_delete","type":"object","properties":{"roomid":{"title":"Roomid","type":"string","description":"群的 id","default":"xxxxxxxx@chatroom"},"wxids":{"title":"Wxids","type":"string","description":"要删除的 wxid,多个用逗号分隔","default":"wxid_xxxxxxxxxxxxx"}}},"Body_query_sql_sql_post":{"title":"Body_query_sql_sql_post","type":"object","properties":{"db":{"title":"Db","type":"string","description":"数据库","default":"MicroMsg.db"},"sql":{"title":"Sql","type":"string","description":"SQL 语句","default":"SELECT * FROM Contact LIMIT 1;"}}},"Body_receive_transfer_transfer_post":{"title":"Body_receive_transfer_transfer_post","type":"object","properties":{"wxid":{"title":"Wxid","type":"string","description":"转账消息里的发送人 wxid","default":"wxid_xxxxxxxxxxxxx"},"transferid":{"title":"Transferid","type":"string","description":"转账消息里的 transferid","default":"transferid"},"transactionid":{"title":"Transactionid","type":"string","description":"转账消息里的 transactionid","default":"transactionid"}}},"Body_send_file_file_post":{"title":"Body_send_file_file_post","type":"object","properties":{"path":{"title":"Path","type":"string","description":"本地文件路径,不支持网络路径","default":"C:\\Projs\\WeChatRobot\\TEQuant.jpeg"},"receiver":{"title":"Receiver","type":"string","description":"roomid 或者 wxid","default":"filehelper"}}},"Body_send_image_image_post":{"title":"Body_send_image_image_post","type":"object","properties":{"path":{"title":"Path","type":"string","description":"图片路径","default":"C:\\Projs\\WeChatRobot\\TEQuant.jpeg"},"receiver":{"title":"Receiver","type":"string","description":"消息接收者,roomid 或者 wxid","default":"filehelper"}}},"Body_send_text_text_post":{"title":"Body_send_text_text_post","required":["msg"],"type":"object","properties":{"msg":{"title":"Msg","type":"string","description":"要发送的消息,换行用\\n表示"},"receiver":{"title":"Receiver","type":"string","description":"消息接收者,roomid 或者 wxid","default":"filehelper"},"aters":{"title":"Aters","type":"string","description":"要 @ 的 wxid,多个用逗号分隔;@所有人 用 notify@all","default":""}}},"HTTPValidationError":{"title":"HTTPValidationError","type":"object","properties":{"detail":{"title":"Detail","type":"array","items":{"$ref":"#/components/schemas/ValidationError"}}}},"Msg":{"title":"Msg","required":["id","type","xml","sender","roomid","content","thumb","extra","is_at","is_self","is_group"],"type":"object","properties":{"id":{"title":"Id","type":"string"},"type":{"title":"Type","type":"integer"},"xml":{"title":"Xml","type":"string"},"sender":{"title":"Sender","type":"string"},"roomid":{"title":"Roomid","type":"string"},"content":{"title":"Content","type":"string"},"thumb":{"title":"Thumb","type":"string"},"extra":{"title":"Extra","type":"string"},"is_at":{"title":"Is At","type":"boolean"},"is_self":{"title":"Is Self","type":"boolean"},"is_group":{"title":"Is Group","type":"boolean"}}},"ValidationError":{"title":"ValidationError","required":["loc","msg","type"],"type":"object","properties":{"loc":{"title":"Location","type":"array","items":{"anyOf":[{"type":"string"},{"type":"integer"}]}},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}}}}}} |