Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fastapi 和 unicorn 实现的可热重启bot示例 #18

Merged
merged 2 commits into from Sep 30, 2021

Conversation

fangjiyuan
Copy link
Member

fastapi 和 unicorn 实现的可热重启bot示例,可以实现web api定制。

fastapi 和 unicorn 实现的可热重启bot示例,可以实现web api定制。
@CLAassistant
Copy link

CLAassistant commented Sep 29, 2021

CLA assistant check
All committers have signed the CLA.

@wj-Mcat
Copy link
Collaborator

wj-Mcat commented Sep 29, 2021

@fangjiyuan Please sign cla agreement and make CI green.

Copy link
Member

@lyleshaw lyleshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR, I have left some comments for it, I hope you can modify according to it to merge this PR~

except Exception as e:
log.exception(e)
return 404
async def send_report(bot,str,str2,str3):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议这里将 str,str2,str3 换为其他变量名,体现变量的含义

examples/hotreload_bot.py Outdated Show resolved Hide resolved
async def send_msg(item:Item,bot=Depends(bot)):
try:
await send_report(bot,item.msg_type,item.name,item.contact_id)
return 200
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

接口返回值建议改为如下格式

{
    'code': 100010,             # error code
    'detail': detail,           # show for user
    'fields': fields,           # show for dev, list
    'success': true             # suc or fail
    'data': data,               # data if success else null, be list or dict
}

以符合 RESTful 规范,下同

去掉了绝对路径
修改了变量名
Copy link
Member

@lyleshaw lyleshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lyleshaw lyleshaw merged commit 56d9aee into wechaty:main Sep 30, 2021
@huan
Copy link
Member

huan commented Apr 20, 2022

Thank you very much for your contribution!

You are welcome to join Wechaty Contributor Program

1. Join Wechaty Organization

You've invited fangjiyuan to Wechaty! They'll be receiving an email shortly. They can also visit https://github.com/wechaty to accept the invitation.

I have invited you to join our Wechaty GitHub Organization, please accept it by following the above message. (See also: wechaty/PMC#16)

2. Update Your Wechaty Contributor Profile

  1. Please open Contributor Hall of Fame and add yourself to the end of the list, so that other contributors will know you better!
  2. Please add yourself to our Website Contributors by creating a PR and refer to this PR link as well.

3. Join The Contributor Only WeChat Room

We also have a WeChat room for contributors only which can discuss Wechaty at a deeper level, you are welcome to join and if you are interested.

Please add @lijiarui wechat: ruirui_0914 and send her this pr link. She will invite you into Wechaty Contributor Room

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants