add interface and fix

This commit is contained in:
“xHuPo” 2024-08-16 17:48:07 +08:00
parent bb46f5adc4
commit c16ee9ca2c
13 changed files with 573 additions and 89 deletions

38
scripts/notify/consts.go Normal file
View file

@ -0,0 +1,38 @@
package main
type FeishuPostMessage struct {
MsgType string `json:"msg_type"`
Content PostContent `json:"content"`
}
type PostContent struct {
Post Post `json:"post"`
}
type Post struct {
ZhCn Message `json:"zh_cn"`
}
type Message struct {
Title string `json:"title"`
Content [][]ContentItem `json:"content"`
}
type ContentItem struct {
Tag string `json:"tag"`
Text string `json:"text,omitempty"`
Unescape bool `json:"un_escape,omitempty"`
Href string `json:"href,omitempty"`
UserID string `json:"user_id,omitempty"`
UserName *string `json:"user_name,omitempty"`
ImageKey string `json:"image_key,omitempty"`
}
type FeishuTextMessage struct {
MsgType string `json:"msg_type"`
Content TextContent `json:"content"`
}
type TextContent struct {
Text string `json:"text"`
}