feat: Rock 回库支持上游校验与强制释放,新增 Token 状态历史
This commit is contained in:
@@ -113,6 +113,25 @@ func (RockToken) TableName() string {
|
||||
return "rock_tokens"
|
||||
}
|
||||
|
||||
// RockTokenStatusLog 记录 Token 的生命周期与状态流转,供状态历史时间线使用。
|
||||
type RockTokenStatusLog struct {
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
TokenID uint `gorm:"not null;index" json:"token_id"`
|
||||
UpstreamTokenID string `gorm:"size:64;not null;default:''" json:"upstream_token_id"`
|
||||
EventType string `gorm:"size:32;not null" json:"event_type"` // created / status_changed / deleted / restored
|
||||
FromStatus string `gorm:"size:32;not null;default:''" json:"from_status"`
|
||||
ToStatus string `gorm:"size:32;not null;default:''" json:"to_status"`
|
||||
Source string `gorm:"size:32;not null;default:''" json:"source"`
|
||||
Reason string `gorm:"size:255;not null;default:''" json:"reason"`
|
||||
Forced bool `gorm:"not null;default:false" json:"forced"`
|
||||
ActorUserID *uint `gorm:"index" json:"actor_user_id,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
func (RockTokenStatusLog) TableName() string {
|
||||
return "rock_token_status_logs"
|
||||
}
|
||||
|
||||
// RockPurchaseLog 是一次采购尝试的主记录。
|
||||
// 每一次真正进入采购流程的尝试都会落一条,包含降级原因与各阶段汇总。
|
||||
type RockPurchaseLog struct {
|
||||
|
||||
Reference in New Issue
Block a user