mirror of
https://github.com/EZ-Api/ez-api.git
synced 2026-01-13 17:47:51 +00:00
Decouple API contract from internal models by introducing dedicated DTOs for requests and responses. - Add Response DTOs for all resources (API Keys, Bindings, Models, Namespaces, etc.) - Update Swagger annotations to use DTOs with field examples instead of internal models - Refactor handlers to bind and return DTO structures - Consolidate request/response definitions in the dto package
26 lines
1.3 KiB
Go
26 lines
1.3 KiB
Go
package dto
|
|
|
|
// LogWebhookConfigResponse represents the log webhook configuration in API responses.
|
|
// @Description Log webhook configuration response
|
|
type LogWebhookConfigResponse struct {
|
|
Enabled bool `json:"enabled" example:"true"`
|
|
URL string `json:"url" example:"https://webhook.example.com/alerts"`
|
|
Secret string `json:"secret" example:"webhook-secret-key"`
|
|
Threshold int `json:"threshold" example:"10"`
|
|
WindowSeconds int `json:"window_seconds" example:"60"`
|
|
CooldownSeconds int `json:"cooldown_seconds" example:"300"`
|
|
StatusCodeThreshold int `json:"status_code_threshold" example:"500"`
|
|
}
|
|
|
|
// UpdateLogWebhookConfigRequest defines the request body for updating log webhook config.
|
|
// @Description Update log webhook configuration request
|
|
type UpdateLogWebhookConfigRequest struct {
|
|
Enabled bool `json:"enabled" example:"true"`
|
|
URL string `json:"url" example:"https://webhook.example.com/alerts"`
|
|
Secret string `json:"secret" example:"webhook-secret-key"`
|
|
Threshold int `json:"threshold" example:"10"`
|
|
WindowSeconds int `json:"window_seconds" example:"60"`
|
|
CooldownSeconds int `json:"cooldown_seconds" example:"300"`
|
|
StatusCodeThreshold int `json:"status_code_threshold" example:"500"`
|
|
}
|