refactor: extract path logic to path.go and run go fmt on codebase

This commit is contained in:
duorameng
2026-05-22 14:52:51 +08:00
parent b6fd889661
commit 4c283a60d5
55 changed files with 409 additions and 420 deletions
+22 -22
View File
@@ -9,17 +9,17 @@ import (
// AgentVO 代理视图对象
type AgentVO struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Status string `json:"status"`
LastSeen *models.LocalTime `json:"last_seen"`
IP string `json:"ip"`
Version string `json:"version"`
BuildTime string `json:"build_time"`
Hostname string `json:"hostname"`
OS string `json:"os"`
Arch string `json:"arch"`
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Status string `json:"status"`
LastSeen *models.LocalTime `json:"last_seen"`
IP string `json:"ip"`
Version string `json:"version"`
BuildTime string `json:"build_time"`
Hostname string `json:"hostname"`
OS string `json:"os"`
Arch string `json:"arch"`
ForceUpdate bool `json:"force_update"`
Enabled bool `json:"enabled"`
SchedulerConfig *AgentSchedulerConfigVO `json:"scheduler_config"`
@@ -44,17 +44,17 @@ func ToAgentVO(agent *models.Agent) *AgentVO {
}
}
return &AgentVO{
ID: agent.ID,
Name: agent.Name,
Description: agent.Description,
Status: agent.Status,
LastSeen: agent.LastSeen,
IP: agent.IP,
Version: agent.Version,
BuildTime: agent.BuildTime,
Hostname: agent.Hostname,
OS: agent.OS,
Arch: agent.Arch,
ID: agent.ID,
Name: agent.Name,
Description: agent.Description,
Status: agent.Status,
LastSeen: agent.LastSeen,
IP: agent.IP,
Version: agent.Version,
BuildTime: agent.BuildTime,
Hostname: agent.Hostname,
OS: agent.OS,
Arch: agent.Arch,
ForceUpdate: agent.ForceUpdate,
Enabled: utils.DerefBool(agent.Enabled, true),
SchedulerConfig: schedulerConfigVO,