From fbc5a9db0317569c4d7ff05a38a3f02b60ce1ed4 Mon Sep 17 00:00:00 2001 From: soulseen Date: Wed, 19 Jun 2019 21:10:01 +0800 Subject: [PATCH] update devops api doc Signed-off-by: soulseen --- pkg/apis/devops/v1alpha2/register.go | 5 +---- pkg/models/devops/json.go | 8 ++++---- pkg/models/devops/membership.go | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/pkg/apis/devops/v1alpha2/register.go b/pkg/apis/devops/v1alpha2/register.go index 665b6726..4cb4c4cd 100644 --- a/pkg/apis/devops/v1alpha2/register.go +++ b/pkg/apis/devops/v1alpha2/register.go @@ -204,7 +204,6 @@ func addWebService(c *restful.Container) error { Metadata(restfulspec.KeyOpenAPITags, tags). Param(webservice.PathParameter("devops", "devops project's Id")). Param(webservice.PathParameter("credentials", "credential's Id")). - Param(webservice.QueryParameter("domain", "credential's domain")). Param(webservice.QueryParameter("content", "get additional content")). Returns(http.StatusOK, RespOK, devops.JenkinsCredential{}). Reads(devops.JenkinsCredential{})) @@ -214,8 +213,6 @@ func addWebService(c *restful.Container) error { Doc("Get project credential pipeline"). Metadata(restfulspec.KeyOpenAPITags, tags). Param(webservice.PathParameter("devops", "devops project's Id")). - Param(webservice.PathParameter("credentials", "credential's Id")). - Param(webservice.QueryParameter("domain", "credential's domain")). Returns(http.StatusOK, RespOK, []devops.JenkinsCredential{}). Reads([]devops.JenkinsCredential{})) @@ -754,7 +751,7 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.POST("/devops/notifycommit"). To(devopsapi.PostNotifyCommit). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("Get notify commit by HTTP POST method."). + Doc("Get notification commit by HTTP POST method."). Consumes("application/json"). Produces("text/plain; charset=utf-8"). Param(webservice.QueryParameter("url", "url of git scm"). diff --git a/pkg/models/devops/json.go b/pkg/models/devops/json.go index 0d351dc7..2ef6eae9 100644 --- a/pkg/models/devops/json.go +++ b/pkg/models/devops/json.go @@ -1025,9 +1025,9 @@ type ReqJson struct { // ToJenkinsfile response type ResJenkinsfile struct { - Status string `json:"status,omitempty" description:"status"` + Status string `json:"status,omitempty" description:"status e.g. ok"` Data struct { - Result string `json:"result,omitempty" description:"result"` + Result string `json:"result,omitempty" description:"result e.g. success"` Jenkinsfile string `json:"jenkinsfile,omitempty" description:"jenkinsfile"` Errors []struct { Location []string `json:"location,omitempty" description:"err location"` @@ -1041,9 +1041,9 @@ type ReqJenkinsfile struct { } type ResJson struct { - Status string `json:"status,omitempty" description:"status"` + Status string `json:"status,omitempty" description:"status e.g. ok"` Data struct { - Result string `json:"result,omitempty" description:"result"` + Result string `json:"result,omitempty" description:"result e.g. success"` JSON struct { Pipeline struct { Stages []interface{} `json:"stages,omitempty" description:"stages"` diff --git a/pkg/models/devops/membership.go b/pkg/models/devops/membership.go index 9e9234cd..ba211c75 100644 --- a/pkg/models/devops/membership.go +++ b/pkg/models/devops/membership.go @@ -24,7 +24,7 @@ type DevOpsProjectMembership struct { Username string `json:"username" description:"member's usernameļ¼Œusername can uniquely identify a user"` ProjectId string `json:"project_id" db:"project_id" description:"the devops projects which project membership belongs to"` Role string `json:"role" description:"devops project membership's role type. e.g. owner '"` - Status string `json:"status" description:"Desperated, status of project membership"` + Status string `json:"status" description:"Desperated, status of project membership. e.g. active "` GrantBy string `json:"grand_by,omitempty" description:"Username of the user who assigned the role"` } -- GitLab