From 4aa3e28f1f3ee7cec5f5b6a66d44ed80c513bfed Mon Sep 17 00:00:00 2001 From: xiangxinyong Date: Fri, 25 Oct 2019 13:29:19 +0800 Subject: [PATCH] modify add issue comment api --- README.md | 1 + api/swagger.yaml | 32 ++++++++++++++++--------- docs/IssueCommentPostParam.md | 11 +++++++++ docs/IssuesApi.md | 16 ++----------- gitee/api_issues.go | 17 ++++--------- gitee/model_issue_comment_post_param.go | 17 +++++++++++++ 6 files changed, 56 insertions(+), 38 deletions(-) create mode 100644 docs/IssueCommentPostParam.md create mode 100644 gitee/model_issue_comment_post_param.go diff --git a/README.md b/README.md index 43e2a90..15c0e09 100644 --- a/README.md +++ b/README.md @@ -271,6 +271,7 @@ Class | Method | HTTP request | Description - [GroupMember](docs/GroupMember.md) - [Hook](docs/Hook.md) - [Issue](docs/Issue.md) + - [IssueCommentPostParam](docs/IssueCommentPostParam.md) - [IssueUpdateParam](docs/IssueUpdateParam.md) - [Label](docs/Label.md) - [Milestone](docs/Milestone.md) diff --git a/api/swagger.yaml b/api/swagger.yaml index 5beda4f..fb2c7c0 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -2931,13 +2931,6 @@ paths: produces: - "application/json" parameters: - - name: "access_token" - in: "formData" - description: "用户授权码" - required: false - type: "string" - x-exportParamName: "AccessToken" - x-optionalDataType: "String" - name: "owner" in: "path" description: "仓库所属空间地址(企业、组织或个人的地址path)" @@ -2956,11 +2949,12 @@ paths: required: true type: "string" x-exportParamName: "Number" - - name: "body" - in: "formData" - description: "The contents of the comment." + - in: "body" + name: "body" + description: "Issue comment内容" required: true - type: "string" + schema: + $ref: "#/definitions/IssueCommentPostParam" x-exportParamName: "Body" responses: 201: @@ -16007,3 +16001,19 @@ definitions: position: 0 body: "body" commit_id: "commit_id" + IssueCommentPostParam: + type: "object" + properties: + access_token: + type: "string" + description: "用户授权码" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + body: + type: "string" + description: "The contents of the comment" + x-exportParamName: "Body" + x-optionalDataType: "String" + example: + access_token: "access_token" + body: "body" diff --git a/docs/IssueCommentPostParam.md b/docs/IssueCommentPostParam.md new file mode 100644 index 0000000..a077e7f --- /dev/null +++ b/docs/IssueCommentPostParam.md @@ -0,0 +1,11 @@ +# IssueCommentPostParam + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccessToken** | **string** | 用户授权码 | [optional] [default to null] +**Body** | **string** | The contents of the comment | [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/docs/IssuesApi.md b/docs/IssuesApi.md index 628a3f3..63aa3f6 100644 --- a/docs/IssuesApi.md +++ b/docs/IssuesApi.md @@ -766,7 +766,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **PostV5ReposOwnerRepoIssuesNumberComments** -> Note PostV5ReposOwnerRepoIssuesNumberComments(ctx, owner, repo, number, body, optional) +> Note PostV5ReposOwnerRepoIssuesNumberComments(ctx, owner, repo, number, body) 创建某个Issue评论 创建某个Issue评论 @@ -779,19 +779,7 @@ Name | Type | Description | Notes **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | **repo** | **string**| 仓库路径(path) | **number** | **string**| Issue 编号(区分大小写,无需添加 # 号) | - **body** | **string**| The contents of the comment. | - **optional** | ***PostV5ReposOwnerRepoIssuesNumberCommentsOpts** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a pointer to a PostV5ReposOwnerRepoIssuesNumberCommentsOpts struct - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - - - **accessToken** | **optional.String**| 用户授权码 | + **body** | [**IssueCommentPostParam**](IssueCommentPostParam.md)| Issue comment内容 | ### Return type diff --git a/gitee/api_issues.go b/gitee/api_issues.go index 950eb57..ddf7b4d 100644 --- a/gitee/api_issues.go +++ b/gitee/api_issues.go @@ -2158,18 +2158,11 @@ IssuesApiService 创建某个Issue评论 * @param owner 仓库所属空间地址(企业、组织或个人的地址path) * @param repo 仓库路径(path) * @param number Issue 编号(区分大小写,无需添加 # 号) - * @param body The contents of the comment. - * @param optional nil or *PostV5ReposOwnerRepoIssuesNumberCommentsOpts - Optional Parameters: - * @param "AccessToken" (optional.String) - 用户授权码 + * @param body Issue comment内容 @return Note */ - -type PostV5ReposOwnerRepoIssuesNumberCommentsOpts struct { - AccessToken optional.String -} - -func (a *IssuesApiService) PostV5ReposOwnerRepoIssuesNumberComments(ctx context.Context, owner string, repo string, number string, body string, localVarOptionals *PostV5ReposOwnerRepoIssuesNumberCommentsOpts) (Note, *http.Response, error) { +func (a *IssuesApiService) PostV5ReposOwnerRepoIssuesNumberComments(ctx context.Context, owner string, repo string, number string, body IssueCommentPostParam) (Note, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -2205,10 +2198,8 @@ func (a *IssuesApiService) PostV5ReposOwnerRepoIssuesNumberComments(ctx context. if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } - if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { - localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) - } - localVarFormParams.Add("body", parameterToString(body, "")) + // body params + localVarPostBody = &body r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err diff --git a/gitee/model_issue_comment_post_param.go b/gitee/model_issue_comment_post_param.go new file mode 100644 index 0000000..2ee393a --- /dev/null +++ b/gitee/model_issue_comment_post_param.go @@ -0,0 +1,17 @@ +/* + * 码云 Open API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 5.3.2 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package gitee + +type IssueCommentPostParam struct { + // 用户授权码 + AccessToken string `json:"access_token,omitempty"` + // The contents of the comment + Body string `json:"body,omitempty"` +} -- GitLab