refactor(service): remove legacy routing and unused code

Removes the legacy route table maintenance logic from the sync service
that populated deprecated Redis keys. Additionally, deletes the unused
TokenService and KeyDTO files to reduce technical debt.
This commit is contained in:
zenfun
2026-01-04 12:07:37 +08:00
parent 4b22b759e7
commit 05cba292d4
3 changed files with 0 additions and 101 deletions

View File

@@ -366,21 +366,6 @@ func (s *SyncService) writeProvidersSnapshot(ctx context.Context, pipe redis.Pip
return fmt.Errorf("marshal provider %d: %w", k.ID, err)
}
pipe.HSet(ctx, "config:providers", fmt.Sprintf("%d", k.ID), payload)
// Legacy route table maintenance for compatibility.
for _, m := range models {
if m == "" {
continue
}
if snap.Status != "active" {
continue
}
if snap.BanUntil > 0 && time.Now().Unix() < snap.BanUntil {
continue
}
routeKey := fmt.Sprintf("route:group:%s:%s", groupName, m)
pipe.SAdd(ctx, routeKey, k.ID)
}
}
return nil
}