notice.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package blocked
  2. import xtime "go-common/library/time"
  3. const (
  4. // NoticeStateOpen state open.
  5. NoticeStateOpen = int8(0)
  6. // NoticeStateClose state close.
  7. NoticeStateClose = int8(1)
  8. )
  9. var (
  10. // NoticeStateDesc state open or close.
  11. NoticeStateDesc = map[int8]string{
  12. NoticeStateOpen: "启用",
  13. NoticeStateClose: "已删除",
  14. }
  15. )
  16. // Notice notice struct.
  17. type Notice struct {
  18. ID int64 `gorm:"column:id" json:"id"`
  19. Content string `gorm:"column:content" json:"content"`
  20. URL string `gorm:"column:url" json:"url"`
  21. Status int8 `gorm:"column:status" json:"status"`
  22. OperID int64 `gorm:"column:oper_id" json:"oper_id"`
  23. Ctime xtime.Time `gorm:"column:ctime" json:"-"`
  24. Mtime xtime.Time `gorm:"column:mtime" json:"-"`
  25. StatusDesc string `gorm:"-" json:"status_desc"`
  26. OPName string `gorm:"-" json:"oname"`
  27. }
  28. // NoticeList is notice list.
  29. type NoticeList struct {
  30. Count int64 `json:"total_count"`
  31. Pn int `json:"pn"`
  32. Ps int `json:"ps"`
  33. List []*Notice `json:"list"`
  34. }
  35. // TableName notice tablename
  36. func (*Notice) TableName() string {
  37. return "blocked_notice"
  38. }