package model import "gorm.io/gorm" // CardObservationEffect 记录卡观测事件副作用的幂等处理进度。 // 处理中的记录代表结果未知,自动重试不得重复执行已提交的套餐扣减。 type CardObservationEffect struct { gorm.Model BaseModel `gorm:"embedded"` EventID string `gorm:"column:event_id;type:varchar(180);not null;uniqueIndex:uk_card_observation_effect_event;comment:Outbox事件ID" json:"event_id"` EffectType string `gorm:"column:effect_type;type:varchar(50);not null;comment:副作用类型" json:"effect_type"` Status int `gorm:"column:status;type:int;not null;default:0;comment:处理状态 0-待处理 1-处理中或结果未知 2-日流量已记录 3-已扣减 4-已完成" json:"status"` } // TableName 指定表名。 func (CardObservationEffect) TableName() string { return "tb_card_observation_effect" }