group.go 1016 B

12345678910111213141516171819202122232425262728293031323334353637
  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. FullPath string `xrom:"full_path varchar(600) comment('完整路径')" json:"full_path"`
  8. }
  9. const (
  10. INBOX = 2000000000
  11. Sent = 2000000001
  12. Drafts = 2000000002
  13. Deleted = 2000000003
  14. Junk = 2000000004
  15. )
  16. var GroupNameToCode = map[string]int{
  17. "INBOX": INBOX,
  18. "Sent Messages": Sent,
  19. "Drafts": Drafts,
  20. "Deleted Messages": Deleted,
  21. "Junk": Junk,
  22. }
  23. var GroupCodeToName = map[int]string{
  24. INBOX: "INBOX",
  25. Sent: "Sent Messages",
  26. Drafts: "Drafts",
  27. Deleted: "Deleted Messages",
  28. Junk: "Junk",
  29. }
  30. func (p *Group) TableName() string {
  31. return "group"
  32. }