You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
103 lines
4.0 KiB
103 lines
4.0 KiB
package common |
|
|
|
// type Mail struct { |
|
// ID int `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"id" redis:"id"` |
|
// Sender int `gorm:"column:sender;type:int(11);default:0;comment:发件人uid,系统为0" json:"sender" redis:"sender"` |
|
// Receiver int `gorm:"column:receiver;type:int(11);default:0;comment:收件人uid,系统为0" json:"receiver" redis:"receiver"` |
|
// } |
|
|
|
const ( |
|
MailExpireTime = 30 * 24 * 60 * 60 // 30天 |
|
MailMaxCount = 100 |
|
) |
|
|
|
const ( |
|
MailTypeNormal = iota + 1 |
|
MailTypeUrgent |
|
) |
|
|
|
const ( |
|
MailSendMethodImmediately = iota + 1 |
|
MailSendMethodTiming |
|
) |
|
|
|
const ( |
|
MailStatusDelete = iota |
|
MailStatusNew |
|
MailStatusRead |
|
MailStatusDraw |
|
) |
|
|
|
// Mail 邮件 |
|
// DraftID 发送邮件的模板id |
|
// sender 发件人 |
|
// Receiver 收件人uid 0是系统邮件 |
|
// Type 邮件类型 1正常 2紧急 |
|
// Enclosure 附件 |
|
// SendMethod 发送方式 1立刻 2定时 |
|
// Status 邮件状态 0删除 1未读 2已读未领取 3已领取 |
|
// Time 收到邮件的时间 |
|
type Mail struct { |
|
ID int `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"ID"` |
|
DraftID string `gorm:"column:draft_id;type:varchar(256);comment:发送邮件的模板id" json:"DraftID"` |
|
Sender string `gorm:"column:sender;type:varchar(64);default:0;comment:发件人名称" json:"Sender"` |
|
Receiver int `gorm:"column:receiver;type:int(11);default:0;comment:收件人uid,系统为0" json:"Receiver"` |
|
Type int `gorm:"column:type;type:int(11);default:1;comment:邮件类型 1正常 2紧急" json:"Type"` |
|
Title string `gorm:"column:title;type:varchar(256);default:0;comment:标题" json:"Title"` |
|
Content string `gorm:"column:content;type:varchar(512);default:0;comment:正文" json:"Content"` |
|
// 附件给单个 |
|
Enc string `gorm:"column:enclosure;type:varchar(512);comment:附件" json:"-"` |
|
Enclosure *CurrencyPair `gorm:"-" json:"Enclosure"` |
|
SendMethod int `gorm:"column:send_method;type:tinyint(4);default:1;comment:发送方式 1立刻 2定时" json:"SendMethod"` |
|
Status int `gorm:"column:status;type:tinyint(4);default:1;comment:邮件状态 0删除 1未读 2已读未领取 3已领取" json:"Status"` |
|
Time int64 `gorm:"column:time;type:bigint(20);default:0;comment:收到邮件时间" json:"Time"` |
|
// 0:全部用户, 1:xx时间前注册用户, 2:有充值用户, 3:新用户(当天注册用户), 4:老用户(非当天注册用户), 5:累计充值达到多少的用户, 6:某渠道用户 |
|
UserTag int `gorm:"column:user_tag;type:int(11);default:0;comment:用户tag" json:"UserTag"` |
|
MaxBirthAt int64 `gorm:"column:max_birth_at;type:bigint(20);default:0;comment:最大出生玩家" json:"MaxBirthAt"` |
|
RechargeAmount int64 `gorm:"column:recharge_amount;type:int(11);default:0;comment:充值额度限制" json:"RechargeAmount"` |
|
ChannelId string `gorm:"column:channel_id;type:varchar(512);default:'';comment:渠道列表" json:"ChannelId"` |
|
URL string `gorm:"column:url;type:varchar(512);default:'';comment:跳转链接" json:"URL"` |
|
} |
|
|
|
func (u *Mail) TableName() string { |
|
return "mail" |
|
} |
|
|
|
const ( |
|
MailDraftStatusDelete = iota |
|
MailDraftStatusNew |
|
MailDraftStatusSent |
|
MailDraftStatusBack // 撤销 |
|
) |
|
|
|
// MailDraft 邮件草稿 |
|
// ID 草稿ID |
|
// sender 发件人 |
|
// Receiver 收件人uid(可以是数组),空数组代表所有人 |
|
// Type 邮件类型 1正常 2紧急 |
|
// Enclosure 附件 |
|
// SendMethod 发送方式 1立刻 2定时 |
|
// SendTime 发送时间 |
|
// Status 邮件状态 0删除 1未发送 2已发送 3已撤销 |
|
// Operator 操作人 |
|
// Time 创建或修改的时间戳 |
|
type MailDraft struct { |
|
ID string |
|
Sender string |
|
Receiver []int |
|
Type int |
|
Title string |
|
Content string |
|
Enclosure *CurrencyPair |
|
SendMethod int |
|
SendTime int64 |
|
Status int |
|
Operator string |
|
Time int64 |
|
// 0:全部用户,1:xx时间前注册的用户,2:有充值用户,3:新用户(当天注册),4:老用户(非当天注册),5:累计充值达到x的用户,6:x渠道用户 |
|
UserTag int |
|
MaxBirthAt int64 |
|
RechargeAmount int64 |
|
ChannelId string |
|
URL string |
|
}
|
|
|