chickenlj commented on code in PR #286:
URL: https://github.com/apache/dubbo-kubernetes/pull/286#discussion_r1610870504
##########
pkg/admin/model/instance.go:
##########
@@ -73,3 +78,105 @@ type State struct {
Tip string `json:"tip"`
Value string `json:"value"`
}
+
+type InstanceDetailResp struct {
+ RpcPort []string `json:"rpcPort"`
+ Ip []string `json:"ip"`
+ AppName []string `json:"appName"`
+ WorkloadName []string `json:"workloadName"`
+ Labels []string `json:"labels"`
+ CreateTime []string `json:"createTime"`
+ ReadyTime []string `json:"readyTime"`
+ RegisterTime []string `json:"registerTime"`
+ RegisterCluster []string `json:"registerCluster"`
+ DeployCluster []string `json:"deployCluster"`
+ Node []string `json:"node"`
+ Image []string `json:"image"`
+ Probes struct {
+ StartupProbe struct {
+ Type string `json:"type"`
+ Port int `json:"port"`
+ Open bool `json:"open"`
+ } `json:"startupProbe"`
+ ReadinessProbe struct {
+ Type string `json:"type"`
+ Port int `json:"port"`
+ Open bool `json:"open"`
+ } `json:"readinessProbe"`
+ LivenessProbe struct {
+ Type string `json:"type"`
+ Port int `json:"port"`
+ Open bool `json:"open"`
+ } `json:"livenessProbe"`
+ } `json:"probes"`
+}
+
+func (r *InstanceDetailResp) FromInstanceDetail(id *InstanceDetail)
*InstanceDetailResp {
+ r.AppName = id.AppName.Values()
+ r.RpcPort = id.RpcPort.Values()
+ r.Ip = id.Ip.Values()
+ r.WorkloadName = id.WorkloadName.Values()
+ r.Labels = id.Labels.Values()
+ r.CreateTime = id.CreateTime.Values()
+ r.ReadyTime = id.ReadyTime.Values()
+ r.RegisterTime = id.RegisterTime.Values()
+ r.RegisterCluster = id.RegisterClusters.Values()
+ r.DeployCluster = id.DeployCluster.Values()
+ r.Node = id.Node.Values()
+ r.Image = id.Image.Values()
+ return r
+}
+
+type InstanceDetail struct {
+ RpcPort Set
+ Ip Set
+ AppName Set
+ WorkloadName Set
+ Labels Set
+ CreateTime Set
+ ReadyTime Set
+ RegisterTime Set
+ RegisterClusters Set
+ DeployCluster Set
+ Node Set
+ Image Set
+}
Review Comment:
I think we should follow the openapi definition to define whether to use set
or string for each field.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]