Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📜 标题(Title)
请提供这个Pull Request中提议的更改的简洁描述:
app/messages/notification_service.py:新增飞书推送、签名校验与时间戳获取增强。🔍 描述(Description)
请描述这个PR做了什么/为什么这些更改是必要的:
send_to_feishu,支持text与post两种消息格式;post模式下按行拆分内容,自动构建飞书富文本结构。timestamp + "\n" + secret作为 HMAC-SHA256 的 key、空串""作为消息体;sign字段,保证与飞书官方文档及社区示例一致,修复19021 sign match fail错误。_get_feishu_timestamp:https://open.feishu.cn/、https://www.feishu.cn/、https://www.cloudflare.com/)的Date响应头获取时间,增加 5 分钟缓存;这些更改是必要的,因为:
19021错误,无法在群里收到消息;📝 类型(Type of Change)
这个PR引入了哪种类型的更改?(请勾选所有适用的选项)
🏗️ 测试(Testing)
请描述您已经进行的测试:
python -m compileall app main.py,确认notification_service.py与其他模块均能成功编译,无语法错误。python main.py启动应用;19021 sign match fail or timestamp is not within one hour from current time,并能在飞书群中收到消息(或至少接口返回StatusCode == 0 / code == 0)。如果适用,请提供测试更改的说明:
secret;text或post),保存配置。📋 检查清单(Checklist)
在您创建这个PR之前,请确保以下所有框都被勾选,方法是在每个框中放置一个
x:注意: 这个PR在所有复选框被勾选之前不会被合并。
感谢您的贡献!