File tree 3 files changed +11
-15
lines changed
3 files changed +11
-15
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,7 @@ in at least 2 of Qiniu's internal systems.
177
177
* [x] 图文消息
178
178
* [x] 图文消息(mpnews)
179
179
* [x] markdown消息
180
+ * [x] 任务卡片消息
180
181
181
182
</details >
182
183
Original file line number Diff line number Diff line change 1
1
package workwx
2
2
3
3
import (
4
- "encoding/json"
5
4
"errors"
6
5
)
7
6
@@ -198,15 +197,6 @@ func (c *WorkwxApp) SendTaskCardMessage(
198
197
btn []TaskCardBtn ,
199
198
isSafe bool ,
200
199
) error {
201
- btnByte , err := json .Marshal (btn )
202
- if err != nil {
203
- return errors .New ("btn convert to json fail: " + err .Error ())
204
- }
205
- var btnSlice []map [string ]interface {}
206
- err = json .Unmarshal (btnByte , & btnSlice )
207
- if err != nil {
208
- return errors .New ("btn convert to []map fail: " + err .Error ())
209
- }
210
200
return c .sendMessage (
211
201
recipient ,
212
202
"taskcard" ,
@@ -215,7 +205,7 @@ func (c *WorkwxApp) SendTaskCardMessage(
215
205
"description" : description ,
216
206
"url" : url ,
217
207
"task_id" : taskid ,
218
- "btn" : btnSlice ,
208
+ "btn" : btn ,
219
209
}, isSafe ,
220
210
)
221
211
}
Original file line number Diff line number Diff line change @@ -941,9 +941,14 @@ type respOAGetApprovalDetail struct {
941
941
942
942
// TaskCardBtn 任务卡片消息按钮
943
943
type TaskCardBtn struct {
944
- Key string `json:"key"`
945
- Name string `json:"name"`
944
+ // Key 按钮key值,用户点击后,会产生任务卡片回调事件,回调事件会带上该key值,只能由数字、字母和“_-@”组成,最长支持128字节
945
+ Key string `json:"key"`
946
+ // Name 按钮名称
947
+ Name string `json:"name"`
948
+ // ReplaceName 点击按钮后显示的名称,默认为“已处理”
946
949
ReplaceName string `json:"replace_name"`
947
- Color string `json:"color"`
948
- IsBold bool `json:"is_bold"`
950
+ // Color 按钮字体颜色,可选“red”或者“blue”,默认为“blue”
951
+ Color string `json:"color"`
952
+ // IsBold 按钮字体是否加粗,默认false
953
+ IsBold bool `json:"is_bold"`
949
954
}
You can’t perform that action at this time.
0 commit comments