mirror of
https://github.com/EZ-Api/ez-api.git
synced 2026-01-13 17:47:51 +00:00
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:
10
internal/dto/key.go
Normal file
10
internal/dto/key.go
Normal 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"`
|
||||
}
|
||||
13
internal/dto/model.go
Normal file
13
internal/dto/model.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package dto
|
||||
|
||||
// ModelDTO is used for create/update of model capabilities.
|
||||
type ModelDTO struct {
|
||||
Name string `json:"name"`
|
||||
ContextWindow int `json:"context_window"`
|
||||
CostPerToken float64 `json:"cost_per_token"`
|
||||
SupportsVision bool `json:"supports_vision"`
|
||||
SupportsFunctions bool `json:"supports_functions"`
|
||||
SupportsToolChoice bool `json:"supports_tool_choice"`
|
||||
SupportsFIM bool `json:"supports_fim"`
|
||||
MaxOutputTokens int `json:"max_output_tokens"`
|
||||
}
|
||||
9
internal/dto/provider.go
Normal file
9
internal/dto/provider.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package dto
|
||||
|
||||
// ProviderDTO defines inbound payload for provider creation/update.
|
||||
type ProviderDTO struct {
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type"`
|
||||
BaseURL string `json:"base_url"`
|
||||
APIKey string `json:"api_key"`
|
||||
}
|
||||
Reference in New Issue
Block a user