From 9d96c58ff91d7b02ce4c43b505f2c11c8f92b82d Mon Sep 17 00:00:00 2001 From: UUBulb <35923940+uubulb@users.noreply.github.com> Date: Sun, 28 Jul 2024 13:43:28 +0800 Subject: [PATCH] api: add DisPlayIndex info (#397) --- service/singleton/api.go | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/service/singleton/api.go b/service/singleton/api.go index d338832..7e351d2 100644 --- a/service/singleton/api.go +++ b/service/singleton/api.go @@ -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 服务器状态子结构 包含服务器信息与状态信息 @@ -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,