dt_notice.go 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. package entity
  2. // DtNotice 消息通知表
  3. type DtNotice struct {
  4. MysqlBaseModel
  5. UserId int64 `json:"userId" gorm:"index:idx_user_id;comment:用户ID(0=系统公告)"`
  6. Type int8 `json:"type" gorm:"index:idx_type;comment:类型: 1=系统通知 2=新闻资讯 3=公告通知"`
  7. Title string `json:"title" gorm:"type:varchar(128);comment:标题"`
  8. TitleVi string `json:"titleVi" gorm:"type:varchar(128);comment:标题(越南语)"`
  9. Content string `json:"content" gorm:"type:text;comment:内容"`
  10. ContentVi string `json:"contentVi" gorm:"type:text;comment:内容(越南语)"`
  11. IsRead int8 `json:"isRead" gorm:"default:0;comment:是否已读: 0=未读 1=已读"`
  12. Status int8 `json:"status" gorm:"default:1;comment:状态: 0=禁用 1=启用"`
  13. }
  14. func (*DtNotice) TableName() string {
  15. return "dt_notice"
  16. }
  17. func (*DtNotice) Comment() string {
  18. return "消息通知表"
  19. }
  20. func NewDtNotice() *DtNotice {
  21. return &DtNotice{}
  22. }
  23. // 消息类型
  24. const (
  25. NoticeTypeSystem = 1 // 系统通知
  26. NoticeTypeNews = 2 // 新闻资讯
  27. NoticeTypeAnnounce = 3 // 公告通知
  28. )