mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-12-26 10:05:58 +08:00
v2.0
This commit is contained in:
24
server/internal/library/notify/feishu/text.go
Normal file
24
server/internal/library/notify/feishu/text.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package feishu
|
||||
|
||||
type TextMessage struct {
|
||||
MsgType MsgType `json:"msg_type"`
|
||||
Content Content `json:"content"`
|
||||
}
|
||||
|
||||
type Content struct {
|
||||
Text string `json:"text"`
|
||||
}
|
||||
|
||||
func (m *TextMessage) Body() map[string]interface{} {
|
||||
m.MsgType = MsgTypeText
|
||||
return structToMap(m)
|
||||
}
|
||||
|
||||
func NewTextMessage() *TextMessage {
|
||||
return &TextMessage{}
|
||||
}
|
||||
|
||||
func (m *TextMessage) SetText(text string) *TextMessage {
|
||||
m.Content.Text = text
|
||||
return m
|
||||
}
|
||||
Reference in New Issue
Block a user