[REV] Update swagger

This commit is contained in:
pujielan 2018-02-05 19:30:44 +08:00
parent f156e4592c
commit a1a6414bc1
2 changed files with 11 additions and 3 deletions

View File

@ -6864,6 +6864,14 @@
"ftp_username": {
"type": "string",
"x-go-name": "FTPUserName"
},
"inner_registry": {
"type": "string",
"x-go-name": "InnerRegistry"
},
"outer_registry": {
"type": "string",
"x-go-name": "OuterRegistry"
}
},
"x-go-package": "github.com/goodrain/rainbond/pkg/api/model"

View File

@ -69,7 +69,7 @@ func (s *ServiceAction) ServiceCheck(scs *api_model.ServiceCheckStruct) (string,
//GetServiceCheckInfo 获取应用源检测信息
func (s *ServiceAction) GetServiceCheckInfo(uuid string)(*exector.ServiceCheckResult, *util.APIHandleError) {
k := fmt.Sprintf("/servicecheck/%s", uuid)
si := exector.ServiceCheckResult
var si exector.ServiceCheckResult
ctx, cancel := context.WithTimeout(context.Background(), 10 * time.Second)
resp, err := s.EtcdCli.Get(ctx, k)
cancel()
@ -78,11 +78,11 @@ func (s *ServiceAction) GetServiceCheckInfo(uuid string)(*exector.ServiceCheckRe
return nil, util.CreateAPIHandleError(500, err)
}
if resp.Count == 0 {
return si, nil
return &si, nil
}
v := resp.Kvs[0].Value
if err := ffjson.Unmarshal(v, &si); err != nil {
return nil, util.CreateAPIHandleError(500, err)
}
return si, nil
return &si, nil
}