zhangmeng
2024-01-19 01dfd9dc8de7b19f9dfa4284722e01bbd5837801
cluster.go
@@ -2,11 +2,10 @@
import (
   "basic.com/pubsub/protomsg.git"
   json "github.com/json-iterator/go"
   jsoniter "github.com/json-iterator/go"
)
type ClusterApi struct {
}
func (api ClusterApi) FindCluster() (flag bool,info protomsg.ClusterAndNodes) {
@@ -19,6 +18,7 @@
   }
   var res Result
   var json = jsoniter.ConfigCompatibleWithStandardLibrary
   if err = json.Unmarshal(body, &res); err != nil {
      return false,info
   }
@@ -53,6 +53,7 @@
   }
   var res Result
   var json = jsoniter.ConfigCompatibleWithStandardLibrary
   if err = json.Unmarshal(body, &res); err != nil {
      return false,nil
   }
@@ -74,6 +75,7 @@
   }
   var res Result
   var json = jsoniter.ConfigCompatibleWithStandardLibrary
   if err = json.Unmarshal(body, &res); err != nil {
      return false,nil
   }
@@ -91,6 +93,7 @@
   }
   var res Result
   var json = jsoniter.ConfigCompatibleWithStandardLibrary
   if err = json.Unmarshal(body, &res); err != nil {
      return false,nil
   }
@@ -111,6 +114,7 @@
   }
   var res Result
   var json = jsoniter.ConfigCompatibleWithStandardLibrary
   if err = json.Unmarshal(body, &res); err != nil {
      return false,nil
   }
@@ -132,6 +136,7 @@
   }
   var res Result
   var json = jsoniter.ConfigCompatibleWithStandardLibrary
   if err = json.Unmarshal(body, &res); err != nil {
      return false,nil
   }
@@ -149,13 +154,13 @@
   }
   var res Result
   var json = jsoniter.ConfigCompatibleWithStandardLibrary
   if err = json.Unmarshal(body, &res); err != nil {
      return false,nil
   }
   return res.Success,res.Data
}
func (api ClusterApi) JoinCluster(paramBody map[string]interface{}) (bool,interface{}) {
   url := DATA_URL_PREFIX + "/cluster/joinCluster"
@@ -167,12 +172,10 @@
   }
   var res Result
   var json = jsoniter.ConfigCompatibleWithStandardLibrary
   if err = json.Unmarshal(body, &res); err != nil {
      return false,nil
   }
   return res.Success,res.Data
}