feat(server): implement management endpoints and redis sync

Enable full resource management via API and support data plane
synchronization.

- Add CRUD handlers for Providers, Models, and Keys using DTOs
- Implement LogWriter service for asynchronous, batched audit logging
- Update SyncService to snapshot full configuration state to Redis
- Register new API routes and initialize background services
- Add configuration options for logging performance tuning
This commit is contained in:
zenfun
2025-12-02 14:26:16 +08:00
parent 2c3a6af7bf
commit 64d71953a6
10 changed files with 479 additions and 40 deletions

10
internal/dto/key.go Normal file
View File

@@ -0,0 +1,10 @@
package dto
// KeyDTO defines payload for key creation/update.
type KeyDTO struct {
ProviderID uint `json:"provider_id"`
KeySecret string `json:"key_secret"`
Balance float64 `json:"balance"`
Status string `json:"status"`
Weight int `json:"weight"`
}