package dto import "time" // APIKeyResponse represents an API key in API responses. // @Description API key response type APIKeyResponse struct { ID uint `json:"id" example:"1"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` GroupID uint `json:"group_id" example:"1"` APIKey string `json:"api_key" example:"sk-xxx..."` AccessToken string `json:"access_token,omitempty"` ExpiresAt *time.Time `json:"expires_at,omitempty"` AccountID string `json:"account_id,omitempty"` ProjectID string `json:"project_id,omitempty"` Weight int `json:"weight" example:"1"` Status string `json:"status" example:"active"` AutoBan bool `json:"auto_ban" example:"true"` BanReason string `json:"ban_reason,omitempty"` BanUntil *time.Time `json:"ban_until,omitempty"` TotalRequests int64 `json:"total_requests" example:"1000"` SuccessRequests int64 `json:"success_requests" example:"950"` FailureRequests int64 `json:"failure_requests" example:"50"` SuccessRate float64 `json:"success_rate" example:"0.95"` FailureRate float64 `json:"failure_rate" example:"0.05"` } // APIKeyDTO defines inbound payload for API key creation/update. // @Description API key create/update request type APIKeyDTO struct { GroupID uint `json:"group_id" example:"1"` APIKey string `json:"api_key" example:"sk-xxx..."` AccessToken string `json:"access_token,omitempty"` RefreshToken string `json:"refresh_token,omitempty"` ExpiresAt *time.Time `json:"expires_at,omitempty"` AccountID string `json:"account_id,omitempty"` ProjectID string `json:"project_id,omitempty"` Weight int `json:"weight,omitempty" example:"1"` Status string `json:"status" example:"active"` AutoBan *bool `json:"auto_ban,omitempty" example:"true"` BanReason string `json:"ban_reason,omitempty"` BanUntil *time.Time `json:"ban_until,omitempty"` }