package entity // DtNotice 消息通知表 type DtNotice struct { MysqlBaseModel UserId int64 `json:"userId" gorm:"index:idx_user_id;comment:用户ID(0=系统公告)"` Type int8 `json:"type" gorm:"index:idx_type;comment:类型: 1=系统通知 2=新闻资讯 3=公告通知"` Title string `json:"title" gorm:"type:varchar(128);comment:标题"` TitleVi string `json:"titleVi" gorm:"type:varchar(128);comment:标题(越南语)"` Content string `json:"content" gorm:"type:text;comment:内容"` ContentVi string `json:"contentVi" gorm:"type:text;comment:内容(越南语)"` IsRead int8 `json:"isRead" gorm:"default:0;comment:是否已读: 0=未读 1=已读"` Status int8 `json:"status" gorm:"default:1;comment:状态: 0=禁用 1=启用"` } func (*DtNotice) TableName() string { return "dt_notice" } func (*DtNotice) Comment() string { return "消息通知表" } func NewDtNotice() *DtNotice { return &DtNotice{} } // 消息类型 const ( NoticeTypeSystem = 1 // 系统通知 NoticeTypeNews = 2 // 新闻资讯 NoticeTypeAnnounce = 3 // 公告通知 )