v39.0.0.0a0

This commit is contained in:
Changhua 2023-07-12 15:23:56 +08:00
parent 37d96524d9
commit c8cfd936f6
3 changed files with 9 additions and 7 deletions

File diff suppressed because one or more lines are too long

View File

@ -33,7 +33,7 @@ setup(
"setuptools", "setuptools",
"fastapi", "fastapi",
"uvicorn[standard]", "uvicorn[standard]",
"wcferry==37.1.25.5", "wcferry==39.0.0.0a2",
], ],
classifiers=[ classifiers=[
"Environment :: Win32 (MS Windows)", "Environment :: Win32 (MS Windows)",

View File

@ -10,7 +10,7 @@ from fastapi import Body, FastAPI
from pydantic import BaseModel from pydantic import BaseModel
from wcferry import Wcf, WxMsg from wcferry import Wcf, WxMsg
__version__ = "37.1.25.5" __version__ = "39.0.0.0a0"
class Msg(BaseModel): class Msg(BaseModel):
@ -50,8 +50,8 @@ class Http(FastAPI):
self.add_api_route("/text", self.send_text, methods=["POST"], summary="发送文本消息") self.add_api_route("/text", self.send_text, methods=["POST"], summary="发送文本消息")
self.add_api_route("/image", self.send_image, methods=["POST"], summary="发送图片消息") self.add_api_route("/image", self.send_image, methods=["POST"], summary="发送图片消息")
self.add_api_route("/file", self.send_file, methods=["POST"], summary="发送文件消息") self.add_api_route("/file", self.send_file, methods=["POST"], summary="发送文件消息")
self.add_api_route("/xml", self.send_xml, methods=["POST"], summary="发送 XML 消息") # self.add_api_route("/xml", self.send_xml, methods=["POST"], summary="发送 XML 消息")
self.add_api_route("/emotion", self.send_emotion, methods=["POST"], summary="发送表情消息") # self.add_api_route("/emotion", self.send_emotion, methods=["POST"], summary="发送表情消息")
self.add_api_route("/sql", self.query_sql, methods=["POST"], summary="执行 SQL如果数据量大注意分页以免 OOM") self.add_api_route("/sql", self.query_sql, methods=["POST"], summary="执行 SQL如果数据量大注意分页以免 OOM")
self.add_api_route("/new-friend", self.accept_new_friend, methods=["POST"], summary="通过好友申请") self.add_api_route("/new-friend", self.accept_new_friend, methods=["POST"], summary="通过好友申请")
self.add_api_route("/chatroom-member", self.add_chatroom_members, methods=["POST"], summary="添加群成员") self.add_api_route("/chatroom-member", self.add_chatroom_members, methods=["POST"], summary="添加群成员")
@ -293,17 +293,19 @@ class Http(FastAPI):
def receive_transfer(self, def receive_transfer(self,
wxid: str = Body("wxid_xxxxxxxxxxxxx", description="转账消息里的发送人 wxid"), wxid: str = Body("wxid_xxxxxxxxxxxxx", description="转账消息里的发送人 wxid"),
transferid: str = Body("transferid", description="转账消息里的 transferid")) -> dict: transferid: str = Body("transferid", description="转账消息里的 transferid"),
transactionid: str = Body("transactionid", description="转账消息里的 transactionid")) -> dict:
"""接收转账 """接收转账
Args: Args:
wxid (str): 转账消息里的发送人 wxid wxid (str): 转账消息里的发送人 wxid
transferid (str): 转账消息里的 transferid transferid (str): 转账消息里的 transferid
transactionid (str): 转账消息里的 transactionid
Returns: Returns:
int: 1 为成功其他失败 int: 1 为成功其他失败
""" """
ret = self.wcf.receive_transfer(wxid, transferid) ret = self.wcf.receive_transfer(wxid, transferid, transactionid)
return {"status": ret, "message": "成功"if ret == 1 else "失败"} return {"status": ret, "message": "成功"if ret == 1 else "失败"}
def decrypt_image(self, def decrypt_image(self,