File tree Expand file tree Collapse file tree 3 files changed +11
-15
lines changed
Expand file tree Collapse file tree 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.
177177* [x] 图文消息
178178* [x] 图文消息(mpnews)
179179* [x] markdown消息
180+ * [x] 任务卡片消息
180181
181182</details >
182183
Original file line number Diff line number Diff line change 11package workwx
22
33import (
4- "encoding/json"
54 "errors"
65)
76
@@ -198,15 +197,6 @@ func (c *WorkwxApp) SendTaskCardMessage(
198197 btn []TaskCardBtn ,
199198 isSafe bool ,
200199) 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- }
210200 return c .sendMessage (
211201 recipient ,
212202 "taskcard" ,
@@ -215,7 +205,7 @@ func (c *WorkwxApp) SendTaskCardMessage(
215205 "description" : description ,
216206 "url" : url ,
217207 "task_id" : taskid ,
218- "btn" : btnSlice ,
208+ "btn" : btn ,
219209 }, isSafe ,
220210 )
221211}
Original file line number Diff line number Diff line change @@ -941,9 +941,14 @@ type respOAGetApprovalDetail struct {
941941
942942// TaskCardBtn 任务卡片消息按钮
943943type 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 点击按钮后显示的名称,默认为“已处理”
946949 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"`
949954}
You can’t perform that action at this time.
0 commit comments