Commit 09f7c237 authored by 李世星's avatar 李世星

fix(修改模板): 202301301651

parent 0db01695
...@@ -73,9 +73,9 @@ func CreateDingMessage(messageType string, msg interface{}, mobiles []string) DD ...@@ -73,9 +73,9 @@ func CreateDingMessage(messageType string, msg interface{}, mobiles []string) DD
func pluginNotice(msg interface{}) string { func pluginNotice(msg interface{}) string {
mateData := msg.(*entity.Matedata) mateData := msg.(*entity.Matedata)
templateBuff := bytes.NewBuffer([]byte{}) templateBuff := bytes.NewBuffer([]byte{})
templateBuff.WriteString(fmt.Sprintf("# 服务通知 \r\n > (节点):%s", mateData.SourceAgent)) templateBuff.WriteString(fmt.Sprintf("# 服务通知 \r\n > 【节点】:%s", mateData.SourceAgent))
for key, value := range mateData.Data { for key, value := range mateData.Data {
templateBuff.WriteString(fmt.Sprintf(" \r\n > (%s):%s", key, value)) templateBuff.WriteString(fmt.Sprintf(" \r\n > 【%s】:%s", key, value))
} }
templateBuff.WriteString(fmt.Sprintf(" \r\n ###### %s", time.Now().Format("2006/01/02 15:04:05"))) templateBuff.WriteString(fmt.Sprintf(" \r\n ###### %s", time.Now().Format("2006/01/02 15:04:05")))
......
...@@ -121,6 +121,7 @@ func ReadingMessage(ctx context.Context, c *Customer) { ...@@ -121,6 +121,7 @@ func ReadingMessage(ctx context.Context, c *Customer) {
} }
matedata, err = c.Format(string(reader.Config().Topic), string(m.Value)) matedata, err = c.Format(string(reader.Config().Topic), string(m.Value))
matedata.SourceAgent = "默认节点"
for _, header := range m.Headers { for _, header := range m.Headers {
if header.Key == "source_agent" { if header.Key == "source_agent" {
matedata.SourceAgent = string(header.Value) matedata.SourceAgent = string(header.Value)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment