Skip to content

Conversation

Poiig
Copy link

@Poiig Poiig commented Apr 25, 2025

在PushReviewEntity中新增user_username字段,以便在推送事件处理中记录用户信息。同时优化了WeComNotifier的HTML标签处理逻辑,保留企业微信的@消息格式,并增加了日志记录。此外,改进了时间戳的格式化处理,使其更易读。

在PushReviewEntity中新增user_username字段,以便在推送事件处理中记录用户信息。同时优化了WeComNotifier的HTML标签处理逻辑,保留企业微信的@消息格式,并增加了日志记录。此外,改进了时间戳的格式化处理,使其更易读。
@Poiig Poiig requested a review from sunmh207 as a code owner April 25, 2025 02:59
@sunmh207
Copy link
Owner

user_username和author是不是重复了?

@Poiig
Copy link
Author

Poiig commented Apr 30, 2025

user_username和author是不是重复了?
user_username在Request中,有时候跟commit对象中的author不一致。可以冗余出来,提供使用。

@sunmh207
Copy link
Owner

sunmh207 commented May 7, 2025

是不是确定用途了再冗余出来?

@Poiig
Copy link
Author

Poiig commented May 7, 2025

是不是确定用途了再冗余出来?

我这边是用到了的,我们gitlab集成了微软AD认证。使用英文名作为账号,同时企微也是英文名。在进行企微机器人推送的时候,通过username能够@到对应的人,来查看review的结果。
我在使用过程中发现,author并不是很准确,取决于用户自己设置的名称,author与username是不一致的。

@yangyl568
Copy link

如何@到对应的人,没看懂 @Poiig

@Poiig
Copy link
Author

Poiig commented Jun 5, 2025

如何@到对应的人,没看懂 @Poiig

git的username与企微英文名一致的情况下,直接@英文名。企微会@到对应的人。
这个PR的目的主要还是解决企微@人的兼容性正则改动,以及对commit消息的时间处理。username只是个额外冗余,留给需要的人用。

@nesnilnehc
Copy link

nesnilnehc commented Jul 28, 2025

如何@到对应的人,没看懂 @Poiig

@sunmh207 @yangyl568

企业微信机器人确实支持通过 <@userid> 格式在消息中 @指定成员,被 @ 提醒的成员会收到消息特别提醒。
其官方文档对此有明确说明:https://developer.work.weixin.qq.com/document/path/91770。

如下示例:
user_username:zhangsan
author:张三

​​文本消息​​:可通过 mentioned_list 或 mentioned_mobile_list 参数指定成员列表(支持 @ALL 或具体成员)。
{ "msgtype": "text", "text": { "content": "请处理问题 @张三", "mentioned_list": ["zhangsan"], // 用户 ID "mentioned_mobile_list": ["13800001111"] // 手机号 } }
​​Markdown 消息​​:需直接在 content 字段中使用 <@userid> 语法(如 <@zhangsan>),​​不支持​​ mentioned_list 参数。
{ "msgtype": "markdown", "markdown": { "content": "**任务提醒**<br>负责人:<@zhangsan> 请今日完成提交。" } }

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.

4 participants