|
@@ -113,10 +113,14 @@ func List(c *gin.Context) {
|
|
|
locker.RLock()
|
|
|
defer locker.RUnlock()
|
|
|
|
|
|
- countryLabelSeqs := make(map[string]int)
|
|
|
+ nodes := healthNodes()
|
|
|
+ sort.SliceStable(nodes, func(i, j int) bool {
|
|
|
+ return nodes[i].CountryCode > nodes[j].CountryCode
|
|
|
+ })
|
|
|
|
|
|
+ countryLabelSeqs := make(map[string]int)
|
|
|
dtoNodes := make([]*dto.Node, 0)
|
|
|
- for _, node := range healthNodes() {
|
|
|
+ for _, node := range nodes {
|
|
|
seq, ok := countryLabelSeqs[node.CountryCode]
|
|
|
if !ok {
|
|
|
countryLabelSeqs[node.CountryCode] = 0
|
|
@@ -125,9 +129,6 @@ func List(c *gin.Context) {
|
|
|
}
|
|
|
dtoNodes = append(dtoNodes, convert2DtoNode(node, countryLabelSeqs[node.CountryCode]))
|
|
|
}
|
|
|
- sort.SliceStable(dtoNodes, func(i, j int) bool {
|
|
|
- return dtoNodes[i].CountryCode > dtoNodes[j].CountryCode
|
|
|
- })
|
|
|
|
|
|
c.JSON(http.StatusOK, dto.ListResponse{
|
|
|
Response: dto.NewOkResponse(),
|