From 75a0ef676b1ad5551802ecc13c59f989cb0cf6cf Mon Sep 17 00:00:00 2001 From: Zhang Dongliang Date: Thu, 8 Aug 2019 15:47:57 +0800 Subject: [PATCH] =?UTF-8?q?hotfix:=20=E5=B0=86=20websocket=20=E7=9A=84=20b?= =?UTF-8?q?roadcast=20=E6=8E=A5=E5=8F=A3=E9=87=8C=20topic=20=E8=BF=99?= =?UTF-8?q?=E4=B8=AA=E5=BF=85=E9=80=89=E5=8F=98=E9=87=8F=E8=AE=BE=E4=B8=BA?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E5=8F=82=E6=95=B0;=20=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E7=BB=99=E4=BA=86=E9=BB=98=E8=AE=A4=E5=80=BC?= =?UTF-8?q?,=E9=9D=9E=E5=BF=85=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/climc/shell/notification.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/cmd/climc/shell/notification.go b/cmd/climc/shell/notification.go index 4604d91640..4cad7ded26 100644 --- a/cmd/climc/shell/notification.go +++ b/cmd/climc/shell/notification.go @@ -57,12 +57,15 @@ func init() { } return nil }) + /** + * 发送全局通知 + */ type NotificationBroadcastOptions struct { // CONTACTTYPE string `help:"User's contacts type, cloud be email|mobile|dingtalk|/webconsole" choices:"email|mobile|dingtalk|webconsole"` - TOPIC string `required:"true" help:"Title or topic of the notification"` - PRIORITY string `help:"Priority of the notification maybe normal|important|fatal" choices:"normal|important|fatal"` - MSG string `help:"The content of the notification"` + Topic string `required:"true" help:"Title or topic of the notification"` + Priority string `help:"Priority of the notification maybe normal|important|fatal" choices:"normal|important|fatal" default:"normal"` + Msg string `help:"The content of the notification"` Remark string `help:"Remark or description of the notification"` // Group bool `help:"Send to group"` } @@ -71,9 +74,9 @@ func init() { msg := notify.SNotifyMessage{} msg.Broadcast = true msg.ContactType = notify.TNotifyChannel("webconsole") - msg.Topic = args.TOPIC - msg.Priority = notify.TNotifyPriority(args.PRIORITY) - msg.Msg = args.MSG + msg.Topic = args.Topic + msg.Priority = notify.TNotifyPriority(args.Priority) + msg.Msg = args.Msg msg.Remark = args.Remark err := notify.Notifications.Send(s, msg)