This commit is contained in:
Robin 2024-11-25 15:40:22 +08:00
parent bdeeb00668
commit f0b384d73a
1 changed files with 23 additions and 18 deletions

View File

@ -5,22 +5,22 @@ import (
) )
type Notification struct { type Notification struct {
Id *int64 `json:"id" bson:"_id"` // 系统通知表id Id *int64 `json:"id" bson:"_id"` // 系统通知表id
SubMid *int64 `json:"sub_mid" bson:"sub_mid"` // 通知发送人mid SubMid *int64 `json:"sub_mid" bson:"sub_mid"` // 通知发送人mid
ObjType *int64 `json:"obj_type" bson:"obj_type"` // 通知接收人类型 ObjType *int64 `json:"obj_type" bson:"obj_type"` // 通知接收人类型
ObjMids []int64 `json:"obj_mids" bson:"obj_mids"` // 通知接收人mids ObjMids []int64 `json:"obj_mids" bson:"obj_mids"` // 通知接收人mids
NType *int64 `json:"n_type" bson:"n_type"` // 消息类型 NType *int64 `json:"n_type" bson:"n_type"` // 消息类型
NDesc *string `json:"n_desc" bson:"n_desc"` // 消息描述 NDesc *string `json:"n_desc" bson:"n_desc"` // 消息描述
Message *string `json:"message" bson:"message"` // 消息内容 Message *string `json:"message" bson:"message"` // 消息内容
Thumbnail *MediaComponent `json:"thumbnail" bson:"thumbnail"` // 缩略图 Title *string `json:"title" bson:"title"` // 主标题
LinkText *string `json:"link_text" bson:"link_text"` // 链接文案 Thumbnail *MediaComponent `json:"thumbnail" bson:"thumbnail"` // 缩略图
Action *string `json:"action" bson:"action"` // 行为 LinkText *string `json:"link_text" bson:"link_text"` // 链接文案
Params *string `json:"params" bson:"params"` // 参数 HyperLinks []*NotifHyperlink `json:"hyperlinks" bson:"hyperlinks"` // 超链接数组
PushTime *int64 `json:"push_time" bson:"push_time"` // 推送时间 PushTime *int64 `json:"push_time" bson:"push_time"` // 推送时间
Status *int64 `json:"status" bson:"status"` // 推送状态 Status *int64 `json:"status" bson:"status"` // 推送状态
Ct *int64 `json:"ct" bson:"ct"` // 创建时间 Ct *int64 `json:"ct" bson:"ct"` // 创建时间
Ut *int64 `json:"ut" bson:"ut"` // 更新时间 Ut *int64 `json:"ut" bson:"ut"` // 更新时间
DelFlag *int64 `json:"del_flag" bson:"del_flag"` // 删除标记 DelFlag *int64 `json:"del_flag" bson:"del_flag"` // 删除标记
} }
func (p *Notification) GetId() int64 { func (p *Notification) GetId() int64 {
@ -105,9 +105,14 @@ type NotifBuilder struct {
ObjType int64 // 目标类型 ObjType int64 // 目标类型
LinkTextTemplateParams []any // 链接模板参数 LinkTextTemplateParams []any // 链接模板参数
Thumbnail *MediaComponent // 缩略图 Thumbnail *MediaComponent // 缩略图
Action string // 行为 HyperLinks []*NotifHyperlink // 超链接数组
Params string // 行为参数
PushTime int64 // 推送时间 PushTime int64 // 推送时间
SetNid func(ctx *gin.Context, nid int64) error // nid存储函数一般用于取消推送 SetNid func(ctx *gin.Context, nid int64) error // nid存储函数一般用于取消推送
GetNid func() int64 // nid访问器 GetNid func() int64 // nid访问器
} }
// 消息内超链接信息
type NotifHyperlink struct {
Action *string `json:"action" bson:"action"` // 行为
Params *string `json:"params" bson:"params"` // 参数
}