Skip to content

Commit

Permalink
api: add DisPlayIndex info (#397)
Browse files Browse the repository at this point in the history
  • Loading branch information
uubulb authored Jul 28, 2024
1 parent 5bb7efd commit 9d96c58
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions service/singleton/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ type CommonResponse struct {
}

type CommonServerInfo struct {
ID uint64 `json:"id"`
Name string `json:"name"`
Tag string `json:"tag"`
LastActive int64 `json:"last_active"`
IPV4 string `json:"ipv4"`
IPV6 string `json:"ipv6"`
ValidIP string `json:"valid_ip"`
ID uint64 `json:"id"`
Name string `json:"name"`
Tag string `json:"tag"`
LastActive int64 `json:"last_active"`
IPV4 string `json:"ipv4"`
IPV6 string `json:"ipv6"`
ValidIP string `json:"valid_ip"`
DisplayIndex int `json:"display_index"`
}

// StatusResponse 服务器状态子结构 包含服务器信息与状态信息
Expand Down Expand Up @@ -141,13 +142,14 @@ func (s *ServerAPIService) GetAllStatus() *ServerStatusResponse {
}
ipv4, ipv6, validIP := utils.SplitIPAddr(host.IP)
info := CommonServerInfo{
ID: v.ID,
Name: v.Name,
Tag: v.Tag,
LastActive: v.LastActive.Unix(),
IPV4: ipv4,
IPV6: ipv6,
ValidIP: validIP,
ID: v.ID,
Name: v.Name,
Tag: v.Tag,
LastActive: v.LastActive.Unix(),
IPV4: ipv4,
IPV6: ipv6,
ValidIP: validIP,
DisplayIndex: v.DisplayIndex,
}
res.Result = append(res.Result, &StatusResponse{
CommonServerInfo: info,
Expand Down

0 comments on commit 9d96c58

Please sign in to comment.