getui_test.go 740 字节
package getui

import (
	"openapi/internal/push"
	"testing"
)

func TestGetui(t *testing.T) {
	var param = make(map[string]interface{})
	param["A"] = "A1"
	param["B"] = 2
	param["C"] = struct{ Id int }{Id: 10}
	notification := &GetuiNotification{}
	err := notification.Init(
		push.DebugModule(true),

		push.AppId("TkpBI4awmg9fBUx3NWKXS6"),
		push.AppKey("5AjJeDOSOZ5ojQpXJFjhg9"),
		push.AppMasterSecret("9VnM8MaA6n84Y5VnOIaSvA"),
		push.ClientId("b5fff5f6b0af551da5f381fa47991828"),

		push.MsgType(1),
		push.Title("测试 hello"),
		push.Content("hello content"),

		push.TransmissionContent("扩展1111"),
		push.Extra(param),
	)
	if err != nil {
		t.Fatal(err)
	}
	err = notification.Send(param)
	if err != nil {
		t.Fatal(err)
	}
}