Files
ez-api/internal/dto/key.go
zenfun aa57af874c feat(core): implement group-based routing and optimize sync
Replace direct provider linkage with group-based routing for Keys and
Providers. This allows for more flexible load balancing and tiering
strategies.

Changes include:
- Remove `ProviderID` from Key model and DTO
- Add `Group` field to Key and Provider models
- Refactor Redis sync to use Hashes for O(1) partial updates
- Update API handlers to perform incremental syncs

BREAKING CHANGE: Key API payload no longer accepts `provider_id`. Redis
configuration storage format has changed from JSON strings to Hashes.
2025-12-02 14:49:03 +08:00

11 lines
266 B
Go

package dto
// KeyDTO defines payload for key creation/update.
type KeyDTO struct {
Group string `json:"group"`
KeySecret string `json:"key_secret"`
Balance float64 `json:"balance"`
Status string `json:"status"`
Weight int `json:"weight"`
}