31 lines
474 B
Go
31 lines
474 B
Go
package model
|
|
|
|
import (
|
|
"admin/internal/db"
|
|
"gorm.io/gorm"
|
|
"time"
|
|
)
|
|
|
|
func init() {
|
|
db.RegisterTableModels(RoleMail{})
|
|
}
|
|
|
|
type MailAttachItem struct {
|
|
ID int32
|
|
Num int64
|
|
ItemType int
|
|
}
|
|
|
|
type RoleMail struct {
|
|
ID int `gorm:"primarykey"`
|
|
RoleIDs string
|
|
ServerID int
|
|
Title string
|
|
Content string
|
|
Attach []*MailAttachItem `gorm:"type:json;serializer:json"`
|
|
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
DeletedAt gorm.DeletedAt `gorm:"index"`
|
|
}
|