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

View file

@ -6,11 +6,11 @@ type FeishuPostMessage struct {
}
type PostContent struct {
Post *Post `json:"post"`
Post Post `json:"post"`
}
type Post struct {
ZhCn *Message `json:"zh_cn"`
ZhCn Message `json:"zh_cn"`
}
type Message struct {
@ -19,33 +19,20 @@ type Message struct {
}
type ContentItem struct {
Tag string `json:"tag"`
*TextContent
*AContent
*AtContent
*ImageContent
}
type TextContent struct {
Text string `json:"text"`
Unescape *bool `json:"un_escape"`
}
type AContent struct {
Text string `json:"text"`
Href string `json:"href"`
}
type AtContent struct {
UserID string `json:"user_id"`
Username *string `json:"username"`
}
type ImageContent struct {
ImageKey string `json:"image_key"`
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"`
}