mirror of
https://github.com/EZ-Api/ez-api.git
synced 2026-01-13 17:47:51 +00:00
feat(provider): add status and banning mechanism
Introduce fields for managing provider status (active, auto_disabled, manual_disabled) and banning logic. - Add Status, AutoBan, BanReason, and BanUntil to Provider model and DTO - Update CreateProvider handler to process new fields with defaults - Extend sync service to propagate status and ban information in snapshots - Serialize BanUntil as Unix timestamp for sync compatibility
This commit is contained in:
@@ -1,11 +1,17 @@
|
||||
package dto
|
||||
|
||||
import "time"
|
||||
|
||||
// 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"`
|
||||
Group string `json:"group"`
|
||||
Models []string `json:"models"` // List of supported model names
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type"`
|
||||
BaseURL string `json:"base_url"`
|
||||
APIKey string `json:"api_key"`
|
||||
Group string `json:"group"`
|
||||
Models []string `json:"models"` // List of supported model names
|
||||
Status string `json:"status"`
|
||||
AutoBan *bool `json:"auto_ban,omitempty"`
|
||||
BanReason string `json:"ban_reason,omitempty"`
|
||||
BanUntil time.Time `json:"ban_until,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user