feat: 优化收发信安全提示与状态标签,增加历史发信收件人管理与租户隔离
Security Checks / security (push) Waiting to run

This commit is contained in:
xuans committed 2026-09-12 09:37:52 +08:00
1 parent b65fb4ec6c
commit 492f2f6322
17 files changed
+615 -25

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
package models
import "time"
// UserContact 保存单个用户的历史写信收件人,用于写信页自动补全与联系人管理
type UserContact struct {
ID int `xorm:"id bigint unsigned not null pk autoincr" json:"id"`
UserID int `xorm:"user_id bigint not null" json:"-"`
Email string `xorm:"email varchar(255) notnull" json:"email"`
Name string `xorm:"name varchar(100) notnull default('')" json:"name"`
LastUsedAt time.Time `xorm:"last_used_at datetime notnull" json:"last_used_at"`
}
func (UserContact) TableName() string { return "user_contact" }
// UserTrustedSender 保存单个用户手动标记信任的发件人白名单,免除安全警告
type UserTrustedSender struct {
ID int `xorm:"id bigint unsigned not null pk autoincr" json:"id"`
UserID int `xorm:"user_id bigint not null" json:"-"`
Email string `xorm:"email varchar(255) notnull" json:"email"`
CreatedAt time.Time `xorm:"created_at datetime created notnull" json:"created_at"`
}
func (UserTrustedSender) TableName() string { return "user_trusted_sender" }