From f85a2965efde9f0557bd5b887a0679fbe32fdf54 Mon Sep 17 00:00:00 2001 From: xwzQmxx <1499273991@qq.com> Date: Fri, 25 Jun 2021 10:53:10 +0800 Subject: [PATCH] fix patch issue api no collaborators param --- api/swagger.yaml | 5 +++++ docs/IssueUpdateParam.md | 1 + gitee/model_issue_update_param.go | 2 ++ test/api_test.go | 29 ++++++++++++++++++++++------- 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/api/swagger.yaml b/api/swagger.yaml index 008b9a2..5f75bd5 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -15937,6 +15937,11 @@ definitions: description: "项目ID" x-exportParamName: "Program" x-optionalDataType: "String" + collaborators: + type: "string" + description: "Issue协助者的个人空间地址, 以 , 分隔" + x-exportParamName: "Collaborators" + x-optionalDataType: "String" description: "update issue information" example: access_token: "access_token" diff --git a/docs/IssueUpdateParam.md b/docs/IssueUpdateParam.md index 6ae4e0a..6351fd1 100644 --- a/docs/IssueUpdateParam.md +++ b/docs/IssueUpdateParam.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **Milestone** | **int32** | 里程碑序号 | [optional] [default to null] **Labels** | **string** | 用逗号分开的标签,名称要求长度在 2-20 之间且非特殊字符。如: bug,performance | [optional] [default to null] **Program** | **string** | 项目ID | [optional] [default to null] +**Collaborators** | **string** | Issue协助者的个人空间地址, 以 , 分隔 | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/gitee/model_issue_update_param.go b/gitee/model_issue_update_param.go index 3f682fa..90f0cc9 100644 --- a/gitee/model_issue_update_param.go +++ b/gitee/model_issue_update_param.go @@ -29,4 +29,6 @@ type IssueUpdateParam struct { Labels string `json:"labels,omitempty"` // 项目ID Program string `json:"program,omitempty"` + // Issue协助者的个人空间地址, 以 , 分隔 + Collaborators string `json:"collaborators,omitempty"` } diff --git a/test/api_test.go b/test/api_test.go index 816177d..2049487 100644 --- a/test/api_test.go +++ b/test/api_test.go @@ -2,12 +2,16 @@ package test import ( "gitee.com/openeuler/go-gitee/gitee" - "github.com/antihax/optional" "golang.org/x/net/context" "golang.org/x/oauth2" "testing" ) +const ( + testOrg = "cve-manage-test" + testRepo = "config" +) + var client *gitee.APIClient func init() { @@ -24,10 +28,10 @@ func init() { } func TestPutV5ReposOwnerRepoPullsNumberLabels(t *testing.T) { - op := &gitee.PutV5ReposOwnerRepoPullsNumberLabelsOpts{ - Body: optional.NewInterface([]string{"feature", "go-gitee-test"}), + op := gitee.PullRequestLabelPostParam{ + Body: []string{"feature", "go-gitee-test"}, } - labels, _, err := client.PullRequestsApi.PutV5ReposOwnerRepoPullsNumberLabels(context.Background(), "cve-manage-test", "phpp", 1, op) + labels, _, err := client.PullRequestsApi.PutV5ReposOwnerRepoPullsNumberLabels(context.Background(), testOrg, testRepo, 1, op) if err != nil { t.Error(err) } else { @@ -36,10 +40,10 @@ func TestPutV5ReposOwnerRepoPullsNumberLabels(t *testing.T) { } func TestPutV5ReposOwnerRepoIssuesNumberLabels(t *testing.T) { - op := &gitee.PutV5ReposOwnerRepoIssuesNumberLabelsOpts{ - Body: optional.NewInterface([]string{"feature", "go-gitee-test"}), + op := gitee.PullRequestLabelPostParam{ + Body: []string{"feature", "go-gitee-test"}, } - labels, _, err := client.LabelsApi.PutV5ReposOwnerRepoIssuesNumberLabels(context.Background(), "cve-manage-test", "config", "I3A2AO", op) + labels, _, err := client.LabelsApi.PutV5ReposOwnerRepoIssuesNumberLabels(context.Background(), testOrg, testRepo, "I3A2AO", op) if err != nil { t.Error(err) } else { @@ -47,3 +51,14 @@ func TestPutV5ReposOwnerRepoIssuesNumberLabels(t *testing.T) { } } + +func TestPatchV5ReposOwnerIssuesNumber(t *testing.T) { + body := gitee.IssueUpdateParam{ + Repo: testRepo, + Collaborators: "zhangjianjun_code", + } + _, _, err := client.IssuesApi.PatchV5ReposOwnerIssuesNumber(context.Background(), testOrg, "I3IZ20", body) + if err != nil { + t.Error(err) + } +} -- Gitee