feat: Rock 回库支持上游校验与强制释放,新增 Token 状态历史

This commit is contained in:
2026-11-09 13:38:57 +08:00
parent b90252c093
commit 38cbb37a08
26 changed files with 1376 additions and 140 deletions
@@ -59,6 +59,14 @@ func TestRestoreRockTokens_UnhidesDeletedToken(t *testing.T) {
t.Fatalf("恢复结果不符: %+v", result)
}
var restoreLogs []model.RockTokenStatusLog
if err := db.Where("token_id = ? AND event_type = ?", available.ID, rockTokenEventRestored).Find(&restoreLogs).Error; err != nil {
t.Fatalf("读取恢复状态日志失败: %v", err)
}
if len(restoreLogs) != 1 || restoreLogs[0].EventType != rockTokenEventRestored || restoreLogs[0].Source != rockTokenSourceRestore {
t.Fatalf("恢复状态日志不符: %+v", restoreLogs)
}
_, total, err = svc.ListTokens(ctx, 1, 20, "", "")
if err != nil {
t.Fatalf("查询列表失败: %v", err)