This commit is contained in:
2025-10-01 00:40:47 +08:00
parent 981e523440
commit f814e682cf

View File

@@ -180,6 +180,9 @@ func (a AuditContextKey) String() string {
// UserActionLog 记录用户的操作历史,用于审计
type UserActionLog struct {
// 用 ID 和 Time 组成复合主键, 防止高并发时时间重复
ID uint `gorm:"primaryKey"`
// Time 是操作发生的时间,作为主键和超表的时间分区键
Time time.Time `gorm:"primaryKey" json:"time"`