code refactor (#1922)

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2020-02-25 18:16:51 +08:00
committed by GitHub
parent abf9fee845
commit 0664eeb559
9 changed files with 87 additions and 766 deletions

View File

@@ -78,7 +78,7 @@ func addWebService(c *restful.Container, devopsClient devops.Interface,
Writes([]sonarqube.SonarStatus{}))
}
if projectPipleineEnable{
if projectPipleineEnable {
projectPipelineHander := NewProjectPipelineHandler(devopsClient, dbClient)
webservice.Route(webservice.GET("/devops/{devops}").
To(projectPipelineHander.GetDevOpsProjectHandler).
@@ -190,8 +190,6 @@ func addWebService(c *restful.Container, devopsClient devops.Interface,
Returns(http.StatusOK, RespOK, devops.ProjectPipeline{}).
Writes(devops.ProjectPipeline{}))
webservice.Route(webservice.POST("/devops/{devops}/credentials").
To(projectPipelineHander.CreateDevOpsProjectCredentialHandler).
Doc("Create a credential in the specified DevOps project").
@@ -785,7 +783,6 @@ The last one is encrypted info, such as the password of the username-password ty
Writes(devops.ResJson{}))
}
if s2iEnable {
s2iHandler := NewS2iBinaryHandler(ksClient, ksInformer, s3Client)
webservice.Route(webservice.PUT("/namespaces/{namespace}/s2ibinaries/{s2ibinary}/file").
@@ -808,7 +805,7 @@ The last one is encrypted info, such as the password of the username-password ty
Param(webservice.PathParameter("file", "the name of binary file")).
Returns(http.StatusOK, RespOK, nil))
}
c.Add(webservice)
return nil