diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..485dee64 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea diff --git a/message/elements.go b/message/elements.go index 155a8d0f..039fa4b2 100644 --- a/message/elements.go +++ b/message/elements.go @@ -161,6 +161,24 @@ func NewUrlShare(url, title, content, image string) *ServiceElement { SubType: "UrlShare", } } +func NewXmlMsg(template string, ResId int64) *ServiceElement { + if ResId == 0 { + ResId = 2 //默认值2 + } + return &ServiceElement{ + Id: int32(ResId), + Content: template, + SubType: "xml", + } +} + +func NewJsonMsg(template string) *ServiceElement { + return &ServiceElement{ + Id: 1, + Content: template, + SubType: "json", + } +} func (e *TextElement) Type() ElementType { return Text