package test import ( "testing" "github.com/tiger1103/gfast/v3/third/reminders" ) // 发布一条安全检查工单提醒 func Test_PublishReminder(t *testing.T) { // 1. 构建消息模板 // 安全检查工单提醒 message := reminders.Reminder{ Type: reminders.Security, // 安全 Status: reminders.Remind, // 提醒 Title: "安全提醒标题", // 巡检类型 Content: "安全提醒内容", // 巡检结果 ProjectID: 8, // 项目 ID ReceiverID: "1", // 消息接收者的 sys_User.Id TargetID: 1, // 对应跳转的主键ID } // 2. 发布提醒 err := reminders.PublishReminder(message, false) // 你发起了安全检查工单提醒 if err != nil { t.Fatal(err) } }