Smail/server/models/group.go
Jinnrry 6455635f74
Feature/v2.9.2 (#344)
* feature/v2.9.0

ui优化

* add test case

add test case

* feature/v2.9.2

bug fix

---------

Co-authored-by: Your Name <you@example.com>
2026-05-31 18:42:58 +08:00

38 lines
1.1 KiB
Go

package models
type Group struct {
ID int `xorm:"id int unsigned not null pk autoincr" json:"id"`
Name string `xorm:"varchar(10) notnull default('') comment('分组名称')" json:"name"`
ParentId int `xorm:"parent_id int unsigned notnull default(0) comment('父分组名称')" json:"parent_id"`
UserId int `xorm:"user_id int unsigned notnull default(0) comment('用户id')" json:"-"`
FullPath string `xrom:"full_path varchar(600) comment('完整路径')" json:"full_path"`
}
const (
INBOX = 2000000000 //收件箱
Sent = 2000000001 //发件箱
Drafts = 2000000002 //草稿箱
Deleted = 2000000003 //垃圾箱
Junk = 2000000004 //广告箱
)
var GroupNameToCode = map[string]int{
"INBOX": INBOX,
"Sent Messages": Sent,
"Drafts": Drafts,
"Deleted Messages": Deleted,
"Junk": Junk,
}
var GroupCodeToName = map[int]string{
INBOX: "INBOX",
Sent: "Sent Messages",
Drafts: "Drafts",
Deleted: "Deleted Messages",
Junk: "Junk",
}
func (p *Group) TableName() string {
return "group"
}