[优化] 接口优化, 心跳请求返回规则摘要

This commit is contained in:
ryan
2026-03-13 11:22:37 +08:00
parent b33923d5f7
commit 3fb4cec99c
23 changed files with 300 additions and 177 deletions
+15 -5
View File
@@ -7,15 +7,20 @@ type APIResponse[T any] struct {
}
type HeartbeatAPIResponse struct {
Success bool `json:"success"`
Message string `json:"message"`
Data any `json:"data"`
AgentSettings *AgentSettings `json:"agent_settings,omitempty"`
Success bool `json:"success"`
Message string `json:"message"`
Data any `json:"data"`
AgentSettings *AgentSettings `json:"agent_settings,omitempty"`
ActiveConfig *ActiveConfigMeta `json:"active_config,omitempty"`
}
type HeartbeatResult struct {
AgentSettings *AgentSettings
ActiveConfig *ActiveConfigMeta
}
type AgentSettings struct {
HeartbeatInterval int `json:"heartbeat_interval"`
SyncInterval int `json:"sync_interval"`
AutoUpdate bool `json:"auto_update"`
UpdateRepo string `json:"update_repo"`
UpdateNow bool `json:"update_now"`
@@ -69,6 +74,11 @@ type ActiveConfigResponse struct {
CreatedAt string `json:"created_at"`
}
type ActiveConfigMeta struct {
Version string `json:"version"`
Checksum string `json:"checksum"`
}
type SupportFile struct {
Path string `json:"path"`
Content string `json:"content"`