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
33 lines
1.6 KiB
Go
33 lines
1.6 KiB
Go
package dto
|
|
|
|
// ModelRegistryStatusResponse represents the model registry status in API responses.
|
|
// @Description Model registry status response
|
|
type ModelRegistryStatusResponse struct {
|
|
Enabled bool `json:"enabled" example:"true"`
|
|
ModelsDevRef string `json:"models_dev_ref" example:"main"`
|
|
ModelsDevURL string `json:"models_dev_url" example:"https://models.dev/v1/models.json"`
|
|
LastRefreshAt int64 `json:"last_refresh_at,omitempty" example:"1704067200"`
|
|
LastError string `json:"last_error,omitempty"`
|
|
RedisMeta map[string]string `json:"redis_meta,omitempty"`
|
|
CacheCurrent *ModelCacheFile `json:"cache_current,omitempty"`
|
|
CachePrev *ModelCacheFile `json:"cache_prev,omitempty"`
|
|
}
|
|
|
|
// ModelCacheFile represents a cached model registry file.
|
|
// @Description Cached model registry file
|
|
type ModelCacheFile struct {
|
|
Version string `json:"version,omitempty"`
|
|
Timestamp int64 `json:"timestamp,omitempty"`
|
|
}
|
|
|
|
// ModelRegistryCheckResponse represents the result of checking model registry upstream.
|
|
// @Description Model registry check result
|
|
type ModelRegistryCheckResponse struct {
|
|
Enabled bool `json:"enabled" example:"true"`
|
|
UpstreamRef string `json:"upstream_ref" example:"main"`
|
|
CurrentVersion string `json:"current_version,omitempty" example:"abc123"`
|
|
LatestVersion string `json:"latest_version,omitempty" example:"def456"`
|
|
NeedsRefresh bool `json:"needs_refresh" example:"true"`
|
|
CurrentUpstreamRef string `json:"current_upstream_ref,omitempty" example:"main"`
|
|
}
|