yao/openapi/setting/types.go
Max 3bc15b1039 feat(openapi): add unified /setting/* endpoints for OpenAPI
- Introduced handlers for the new /setting/* endpoints in the OpenAPI module.
- Updated import statements to include the new setting package for better organization.
- Enhanced routing capabilities to support the new settings functionality.
2026-04-28 19:33:27 +08:00

55 lines
1.8 KiB
Go

package setting
// SystemInfoData is the top-level response for GET /setting/system.
type SystemInfoData struct {
App AppInfo `json:"app"`
Deployment string `json:"deployment"`
DeploymentLabel string `json:"deployment_label"`
LicenseKey string `json:"license_key,omitempty"`
Server VersionInfo `json:"server"`
Client VersionInfo `json:"client"`
Environment string `json:"environment"`
EnvironmentLabel string `json:"environment_label"`
Technical TechnicalInfo `json:"technical"`
Promotions []Promotion `json:"promotions,omitempty"`
}
// Promotion is a localized CTA banner returned by the API.
type Promotion struct {
ID string `json:"id"`
Title string `json:"title"`
Desc string `json:"desc"`
Link string `json:"link"`
Label string `json:"label"`
}
// AppInfo describes the running application.
type AppInfo struct {
Name string `json:"name"`
Short string `json:"short"`
Description string `json:"description"`
Logo string `json:"logo"`
Version string `json:"version"`
}
// VersionInfo carries build metadata for a component (engine / CUI).
type VersionInfo struct {
Version string `json:"version"`
BuildDate string `json:"build_date"`
CommitSHA string `json:"commit"`
}
// TechnicalInfo contains runtime / infrastructure details.
type TechnicalInfo struct {
Listen string `json:"listen"`
DBDriver string `json:"db_driver"`
SessionStore string `json:"session_store"`
}
// CheckUpdateResult is the response for POST /setting/system/check-update.
type CheckUpdateResult struct {
HasUpdate bool `json:"has_update"`
CurrentVersion string `json:"current_version"`
LatestVersion string `json:"latest_version,omitempty"`
DownloadURL string `json:"download_url,omitempty"`
}