request_test.go 283 B

12345678910111213141516171819202122
  1. package signature_request
  2. import (
  3. "encoding/json"
  4. "testing"
  5. )
  6. func TestDingTalkAlert(t *testing.T) {
  7. var msg DingTalkTextAlert
  8. msg.MsgType = "text"
  9. msg.Text.Content = "测试"
  10. js, _ := json.Marshal(msg)
  11. alert := DingTalkAlert(
  12. "xxx",
  13. "xxx",
  14. js,
  15. )
  16. t.Log(alert)
  17. }