Skip to content

Commit

Permalink
新增事件消息类型
Browse files Browse the repository at this point in the history
企业微信App相关事件
1. 点击菜单 click
2. 点击菜单链接 view
3. 用户订阅与取消订阅: subscribe unsubscribe
3. 未知事件类型: sdk中未定义的事件类型, 返回原始的body, 用于debug
  • Loading branch information
shuai.yang committed Sep 8, 2022
1 parent 909f985 commit 806760a
Show file tree
Hide file tree
Showing 5 changed files with 500 additions and 68 deletions.
61 changes: 61 additions & 0 deletions docs/rx_msg.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Name|XML|Type|Doc
`AgentID`|`AgentID`|`int64`|企业应用的id,整型。可在应用的设置页面查看
`Event`|`Event`|`EventType`|事件类型 MsgType为event存在
`ChangeType`|`ChangeType`|`ChangeType`|变更类型 Event为change_external_contact存在

```go
// MessageType 消息类型
type MessageType string
Expand Down Expand Up @@ -81,6 +82,35 @@ const ChangeTypeCreateUser ChangeType = "create_user"
// ChangeTypeUpdateUser 更新成员事件
const ChangeTypeUpdateUser ChangeType = "update_user"

// EventTypeAppMenuClick 点击菜单
const EventTypeAppMenuClick = "click"

// EventTypeAppMenuCView 打开菜单链接
const EventTypeAppMenuView = "view"

// EventTypeAppMenuScanCodePush 扫码上传
const EventTypeAppMenuScanCodePush = "scancode_push"

// EventTypeAppMenuScanCodeWaitMsg 扫码等待消息
const EventTypeAppMenuScanCodeWaitMsg = "scancode_waitmsg"

// EventTypeAppMenuPicSysPhoto 弹出系统拍照发图
const EventTypeAppMenuPicSysPhoto = "pic_sysphoto"

// EventTypeAppMenuPicPhotoOrAlbum 弹出系统拍照发图
const EventTypeAppMenuPicPhotoOrAlbum = "pic_photo_or_album"

// EventTypeAppMenuPicWeixin 弹出微信相册发图器
const EventTypeAppMenuPicWeixin = "pic_weixin"

// EventTypeAppMenuLocationSelect 弹出微信位置选择器
const EventTypeAppMenuLocationSelect = "location_select"

// EventTypeAppSubscribe 应用订阅
const EventTypeAppSubscribe = "subscribe"

// EventTypeAppUnsubscribe 应用订阅取消
const EventTypeAppUnsubscribe = "unsubscribe"
```

### `rxTextMessageSpecifics` 接收的文本消息,特有字段
Expand Down Expand Up @@ -242,3 +272,34 @@ Name|XML|Type|Doc
`Web`|`Web`|`string`|网页类型属性,扩展属性类型为1时填写
`Title`|`Title`|`string`|网页的展示标题
`Url`|`Url`|`string`|网页的url

### `rxEventAppMenuClick` 接受的事件消息,应用菜单点击事件

Name|XML|Type|Doc
:---|:--|:---|:--
`EventKey`|`EventKey`|`string`|事件key

### `rxEventAppMenuView ` 接受的事件消息,应用菜单点击链接事件

Name|XML|Type|Doc
:---|:--|:---|:--
`EventKey`|`EventKey`|`string`|事件key

### `rxEventAppSubscribe` 接受的事件消息,用户订阅事件

Name|XML|Type|Doc
:---|:--|:---|:--
`EventKey`|`EventKey`|`string`|事件key

### `rxEventAppUnsubscribe` 接受的事件消息,用户取消订阅事件

Name|XML|Type|Doc
:---|:--|:---|:--
`EventKey`|`EventKey`|`string`|事件key

### `rxEventUnknown` 接受的事件消息,未定义的事件类型

Name|XML|Type|Doc
:---|:--|:---|:--
`EventType`|`-`|`string`|事件类型
`Raw`|`-`|`string`|原始的消息体

0 comments on commit 806760a

Please sign in to comment.