Skip to content

Commit

Permalink
feat: 更新飞书 Interactive 卡片格式 (不再支持外链图片)
Browse files Browse the repository at this point in the history
  • Loading branch information
icyleaf committed Nov 9, 2023
1 parent 8dcec0b commit fa6244b
Show file tree
Hide file tree
Showing 8 changed files with 242 additions and 56 deletions.
4 changes: 4 additions & 0 deletions docs/user-guide/webhooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ The following variables are all provided.
```ruby
{
event: @event,
username: @username,
email: @email,
title: @title,
app_name: @name,
device_type: @device_type,
Expand All @@ -31,6 +33,8 @@ Output:
```json
{
"event": "upload_events",
"username": "foobar",
"email": "[email protected]",
"title": "Zealot upload 1.0.0 version",
"app_name": "Zealot",
"device_type": "iOS",
Expand Down
65 changes: 53 additions & 12 deletions docs/user-guide/webhooks/feishu.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,68 @@ Use card format could use partly of markdown syntax:
"enable_forward": true
},
"elements": [
{
"tag": "div",
"fields": [
{
"is_short": true,
"text": {
"tag": "lark_md",
"content": "**Platform**\n#{@device_type}"
}
},
{
"is_short": true,
"text": {
"tag": "lark_md",
"content": "**Version**\n#{@release_version} (#{@build_version})"
}
},
{
"is_short": true,
"text": {
"tag": "lark_md",
"content": "**Developer**\n#{@username}"
}
},
{
"is_short": true,
"text": {
"tag": "lark_md",
"content": "**Upload date**\n#{@uploaded_at}"
}
},
]
},
{
"tag": "div",
"text": {
"content": "## #{@title}\nPlatform: #{@device_type}\nUplaod at: #{@uploaded_at}\nInstall QRcode:\n![qrcode](#{@qrcode_url})",
"content": "**Changelog**\n#{@changelog}",
"tag": "lark_md"
}
},
{
"actions": [{
"tag": "button",
"text": {
"content": "Install",
"tag": "lark_md"
},
"url": @install_url,
"type": "default",
"value": {}
}],
"actions": [
{
"tag": "button",
"text": {
"content": "🐞 Go to app",
"tag": "lark_md"
},
"url": "#{@release_url}",
"type": "primary",
"value": {}
}
],
"tag": "action"
}
]
],
"header": {
"title": {
"content": "#{@title}",
"tag": "plain_text"
}
}
}
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@ Zealot 为每个应用渠道都提供一个消息通知的网络钩子,网络
```ruby
{
event: @event,
username: @username,
email: @email,
title: @title,
app_name: @name,
name: @app_name,
app_name: @app_name,
device_type: @device_type,
release_version: @release_version,
build_version: @build_version,
size: @file_size,
changelog: @changelog,
release_url: @release_url,
install_url: @install_url,
icon_url: @icon_url,
qrcode_url: @qrcode_url,
Expand All @@ -34,16 +38,19 @@ Zealot 为每个应用渠道都提供一个消息通知的网络钩子,网络
```json
{
"event": "upload_events",
"username": "foobar",
"email": "[email protected]",
"title": "Zealot 样例 iOS 内测版上传了 1.0.0 版本",
"app_name": "Zealot 样例 iOS 内测版",
"device_type": "iOS",
"release_version": "1.0.0",
"build_version": "1",
"size": "30 MB",
"changelog": "- 新增了 A 功能\n- 修复了 B 问题\n- 发布 1.0.0 版本",
"release_url": "https://zealot.test/apps/x3gd/100",
"install_url": "https://zealot.test/api/apps/download/12354",
"icon_url": "https://zealot.test/api/apps/icon.png",
"qrcode_url": "https://zealot.test/api/apps/354/qrcode",
"uploaded_at": "2019-12-30 11:33:00",
"changelog": "- 新增了 A 功能\n- 修复了 B 问题\n- 发布 1.0.0 版本",
"uploaded_at": "2019-12-30 11:33:00"
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

## Interactive 卡片格式

通过这种格式可以实现支持 markdown 的部分语法:
通过这种格式可以实现支持 markdown 的部分语法(不支持外链图片展示)

```ruby
{
Expand All @@ -27,27 +27,68 @@
"enable_forward": true
},
"elements": [
{
"tag": "div",
"fields": [
{
"is_short": true,
"text": {
"tag": "lark_md",
"content": "**平台**\n#{@device_type}"
}
},
{
"is_short": true,
"text": {
"tag": "lark_md",
"content": "**版本**\n#{@release_version} (#{@build_version})"
}
},
{
"is_short": true,
"text": {
"tag": "lark_md",
"content": "**最后提交者**\n#{@username}"
}
},
{
"is_short": true,
"text": {
"tag": "lark_md",
"content": "**上传时间**\n#{@uploaded_at}"
}
},
]
},
{
"tag": "div",
"text": {
"content": "## #{@title}\n平台: #{@device_type}\n上传时间: #{@uploaded_at}\n安装二维码:\n![qrcode](#{@qrcode_url})",
"content": "**变更历史**\n#{@changelog}",
"tag": "lark_md"
}
},
{
"actions": [{
"tag": "button",
"text": {
"content": "点击安装",
"tag": "lark_md"
},
"url": @install_url,
"type": "default",
"value": {}
}],
"actions": [
{
"tag": "button",
"text": {
"content": "🐞 版本详情",
"tag": "lark_md"
},
"url": "#{@release_url}",
"type": "primary",
"value": {}
}
],
"tag": "action"
}
]
],
"header": {
"title": {
"content": "#{@title}",
"tag": "plain_text"
}
}
}
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@ Zealot 为每个应用渠道都提供一个消息通知的网络钩子,网络
```ruby
{
event: @event,
username: @username,
email: @email,
title: @title,
app_name: @name,
name: @app_name,
app_name: @app_name,
device_type: @device_type,
release_version: @release_version,
build_version: @build_version,
size: @file_size,
changelog: @changelog,
release_url: @release_url,
install_url: @install_url,
icon_url: @icon_url,
qrcode_url: @qrcode_url,
Expand All @@ -34,16 +38,19 @@ Zealot 为每个应用渠道都提供一个消息通知的网络钩子,网络
```json
{
"event": "upload_events",
"username": "foobar",
"email": "[email protected]",
"title": "Zealot 样例 iOS 内测版上传了 1.0.0 版本",
"app_name": "Zealot 样例 iOS 内测版",
"device_type": "iOS",
"release_version": "1.0.0",
"build_version": "1",
"size": "30 MB",
"changelog": "- 新增了 A 功能\n- 修复了 B 问题\n- 发布 1.0.0 版本",
"release_url": "https://zealot.test/apps/x3gd/100",
"install_url": "https://zealot.test/api/apps/download/12354",
"icon_url": "https://zealot.test/api/apps/icon.png",
"qrcode_url": "https://zealot.test/api/apps/354/qrcode",
"uploaded_at": "2019-12-30 11:33:00",
"changelog": "- 新增了 A 功能\n- 修复了 B 问题\n- 发布 1.0.0 版本",
"uploaded_at": "2019-12-30 11:33:00"
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

## Interactive 卡片格式

通过这种格式可以实现支持 markdown 的部分语法:
通过这种格式可以实现支持 markdown 的部分语法(不支持外链图片展示)

```ruby
{
Expand All @@ -27,27 +27,68 @@
"enable_forward": true
},
"elements": [
{
"tag": "div",
"fields": [
{
"is_short": true,
"text": {
"tag": "lark_md",
"content": "**平台**\n#{@device_type}"
}
},
{
"is_short": true,
"text": {
"tag": "lark_md",
"content": "**版本**\n#{@release_version} (#{@build_version})"
}
},
{
"is_short": true,
"text": {
"tag": "lark_md",
"content": "**最后提交者**\n#{@username}"
}
},
{
"is_short": true,
"text": {
"tag": "lark_md",
"content": "**上传时间**\n#{@uploaded_at}"
}
},
]
},
{
"tag": "div",
"text": {
"content": "## #{@title}\n平台: #{@device_type}\n上传时间: #{@uploaded_at}\n安装二维码:\n![qrcode](#{@qrcode_url})",
"content": "**变更历史**\n#{@changelog}",
"tag": "lark_md"
}
},
{
"actions": [{
"tag": "button",
"text": {
"content": "点击安装",
"tag": "lark_md"
},
"url": @install_url,
"type": "default",
"value": {}
}],
"actions": [
{
"tag": "button",
"text": {
"content": "🐞 版本详情",
"tag": "lark_md"
},
"url": "#{@release_url}",
"type": "primary",
"value": {}
}
],
"tag": "action"
}
]
],
"header": {
"title": {
"content": "#{@title}",
"tag": "plain_text"
}
}
}
}
```
4 changes: 4 additions & 0 deletions versioned_docs/version-5.0.0/user-guide/webhooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ The following variables are all provided.
```ruby
{
event: @event,
username: @username,
email: @email,
title: @title,
app_name: @name,
device_type: @device_type,
Expand All @@ -31,6 +33,8 @@ Output:
```json
{
"event": "upload_events",
"username": "foobar",
"email": "[email protected]",
"title": "Zealot upload 1.0.0 version",
"app_name": "Zealot",
"device_type": "iOS",
Expand Down
Loading

1 comment on commit fa6244b

@vercel
Copy link

@vercel vercel bot commented on fa6244b Nov 9, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.