代码拉取完成,页面将自动刷新
package dingtalkutils
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestExists(t *testing.T) {
asserter := assert.New(t)
asserter.True(true)
webhook := "https://oapi.dingtalk.com/robot/send?access_token=cfe9ee228d4f04c48999388fbdedbb15e2b8f665b3789af4641b5e87416a0e93"
secret := "SEC6a1e3b51a22da3656cc55cc8eeac59973d793ef4ff7e9b8a864f892706a97c96"
data := make(map[string]interface{})
content := make(map[string]string)
text := "just for test"
content["content"] = text
data["msgtype"] = "text"
data["text"] = content
doErr := SendMapData(webhook, secret, data)
asserter.Nil(doErr)
data = make(map[string]interface{})
content = make(map[string]string)
text = "at some one for test"
content["content"] = text
data["msgtype"] = "text"
toAtMap := map[string]interface{}{
"atMobiles": []string{
"15870679047",
"18665922663",
},
"isAtAll": false,
}
data["text"] = content
data["at"] = toAtMap
doErr = SendMapData(webhook, secret, data)
asserter.Nil(doErr)
data = make(map[string]interface{})
content = make(map[string]string)
text = "at all for test"
content["content"] = text
data["msgtype"] = "text"
toAtMap = map[string]interface{}{
"isAtAll": true,
}
data["at"] = toAtMap
data["text"] = content
doErr = SendMapData(webhook, secret, data)
asserter.Nil(doErr)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。