group.go 926 B

123456789101112131415161718192021222324252627282930313233343536
  1. package models
  2. type Group struct {
  3. ID int `xorm:"id int unsigned not null pk autoincr" json:"id"`
  4. Name string `xorm:"varchar(10) notnull default('') comment('分组名称')" json:"name"`
  5. ParentId int `xorm:"parent_id int unsigned notnull default(0) comment('父分组名称')" json:"parent_id"`
  6. UserId int `xorm:"user_id int unsigned notnull default(0) comment('用户id')" json:"-"`
  7. }
  8. const (
  9. INBOX = 2000000000
  10. Sent = 2000000001
  11. Drafts = 2000000002
  12. Deleted = 2000000003
  13. Junk = 2000000004
  14. )
  15. var GroupNameToCode = map[string]int{
  16. "INBOX": INBOX,
  17. "Sent Messages": Sent,
  18. "Drafts": Drafts,
  19. "Deleted Messages": Deleted,
  20. "Junk": Junk,
  21. }
  22. var GroupCodeToName = map[int]string{
  23. INBOX: "INBOX",
  24. Sent: "Sent Messages",
  25. Drafts: "Drafts",
  26. Deleted: "Deleted Messages",
  27. Junk: "Junk",
  28. }
  29. func (p *Group) TableName() string {
  30. return "group"
  31. }