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

add new event #106

Merged
merged 1 commit into from Sep 8, 2022
Merged

add new event #106

merged 1 commit into from Sep 8, 2022

Conversation

shuaiyy
Copy link

@shuaiyy shuaiyy commented Aug 27, 2022

新增事件消息类型:

  • 企业微信App菜单事件
    • 点击菜单 click
    • 点击菜单链接 view
  • 未知事件类型,用于debug

Copy link
Owner

@xen0n xen0n left a comment

Choose a reason for hiding this comment

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

Thanks!

大体 okay,不过具体姿势有点问题,提交信息(commit message)也稍微认真按照规范写一下会比较好(有时候别人代码写得 OK 除了 commit message 没有按 conventional 格式来,为了优化新人体验,也就算了,这次你反正也得 squash 你的提交所以就一并要求了)

rx_msg.go Outdated
@@ -181,3 +181,21 @@ func (m *RxMessage) EventChangeTypeCreateUser() (*rxEventChangeTypeCreateUser, b
y, ok := m.extras.(*rxEventChangeTypeCreateUser)
return y, ok
}

// EventAppMenuClick 点击菜单事件
Copy link
Owner

Choose a reason for hiding this comment

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

请照着其他同类方法的注释写这些新方法的注释

rx_msg.go Outdated

// EventUnknown 未定义的event类型
func (m *RxMessage) EventUnknown() (*rxEventUnknow, bool) {
y, ok := m.extras.(*rxEventUnknow)
Copy link
Owner

Choose a reason for hiding this comment

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

rxEventUnknow 拼错了

rx_msg.md.go Outdated
Comment on lines 64 to 82
// 应用菜单事件
const (
// EventTypeAppMenuClick 点击菜单
EventTypeAppMenuClick = "click"
// EventTypeAppMenuCView 打开菜单链接
EventTypeAppMenuView = "view"
// EventTypeAppMenuScanCodePush 扫码上传
EventTypeAppMenuScanCodePush = "scancode_push"
// EventTypeAppMenuScanCodeWaitMsg 扫码等待消息
EventTypeAppMenuScanCodeWaitMsg = "scancode_waitmsg"
// EventTypeAppMenuPicSysPhoto 弹出系统拍照发图
EventTypeAppMenuPicSysPhoto = "pic_sysphoto"
// EventTypeAppMenuPicPhotoOrAlbum 弹出系统拍照发图
EventTypeAppMenuPicPhotoOrAlbum = "pic_photo_or_album"
// EventTypeAppMenuPicWeixin 弹出微信相册发图器
EventTypeAppMenuPicWeixin = "pic_weixin"
// EventTypeAppMenuLocationSelect 弹出微信位置选择器
EventTypeAppMenuLocationSelect = "location_select"
)
Copy link
Owner

Choose a reason for hiding this comment

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

你得改相应的 md 文件然后 go generate 吧,否则下次这些更改就没了

你在写这个文件的时候,编辑器应该警告你不要动它了,文件头也告诉你这个文件怎么生成的了。。。

@xen0n
Copy link
Owner

xen0n commented Aug 27, 2022

  1. 你写在这个 PR 正文的那段话就是不错的 commit message
  2. 如果这是你工作上要用的东西,尽量不要加班,周末对自己好一点 ;-)

@shuaiyy
Copy link
Author

shuaiyy commented Aug 27, 2022

  1. 你写在这个 PR 正文的那段话就是不错的 commit message
  2. 如果这是你工作上要用的东西,尽量不要加班,周末对自己好一点 ;-)

thx! 大佬看的好认真,我下周改一下;确实没怎么看代码规范,也没看项目的代码逻辑,只想着实现我需要的功能了T.T

@xen0n
Copy link
Owner

xen0n commented Sep 5, 2022

Ping

Copy link
Owner

@xen0n xen0n left a comment

Choose a reason for hiding this comment

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

Mostly LGTM except one nit, thanks!

docs/rx_msg.md Outdated
const EventTypeAppSubscribe = "subscribe"

// EventTypeAppUnSubscribe 应用订阅取消
const EventTypeAppUnSubscribe = "unsubscribe"
Copy link
Owner

Choose a reason for hiding this comment

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

Unsubscribe 是一个词,只需要大写一个首字母即可

@xen0n
Copy link
Owner

xen0n commented Sep 7, 2022

改好之后,rebase(不允许有 merge 提交),squash 成单个提交,改提交说明

或者我帮你搞?

@shuaiyy
Copy link
Author

shuaiyy commented Sep 7, 2022

改好之后,rebase(不允许有 merge 提交),squash 成单个提交,改提交说明

或者我帮你搞?

我弄吧,

docs/rx_msg.md Outdated
const EventTypeAppUnsubscribe = "unsubscribe"

// EventTypeUnknown 未在本项目中定义与实现的event类型
const EventTypeUnknown = ".*"
Copy link
Owner

Choose a reason for hiding this comment

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

这个没用到吧。。实际上他也不会被当作正则来用(未知消息类型,直接看取到的值类型就知道他“未知”了),去掉就好了

Copy link
Author

Choose a reason for hiding this comment

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

好的

企业微信App相关事件
1. 点击菜单 click
2. 点击菜单链接 view
3. 用户订阅与取消订阅: subscribe unsubscribe
3. 未知事件类型: sdk中未定义的事件类型, 返回原始的body, 用于debug
@xen0n
Copy link
Owner

xen0n commented Sep 8, 2022

虽然你的 commit message 里“3. 未知事件类型: sdk中未定义的事件类型, 返回原始的body, 用于debug”这里序号 3 重复了,但无伤大雅,先给你合了

bors r+

十分感谢贡献!

@bors
Copy link
Contributor

bors bot commented Sep 8, 2022

Build succeeded:

@bors bors bot merged commit 5ffd0c1 into xen0n:develop Sep 8, 2022
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

2 participants