From acd20a22098abd37786036143b522c58e36bf3c7 Mon Sep 17 00:00:00 2001 From: zengchen1024 Date: Mon, 27 Apr 2020 11:37:55 +0800 Subject: [PATCH] fix response of get single commit --- README.md | 2 ++ api/swagger.yaml | 14 +++++++++++++- docs/CommitTree.md | 11 +++++++++++ docs/RepoCommit.md | 2 +- docs/SingleCommit.md | 10 ++++++++++ gitee/model_commit_tree.go | 15 +++++++++++++++ gitee/model_repo_commit.go | 18 +++++++++--------- gitee/model_single_commit.go | 14 ++++++++++++++ 8 files changed, 75 insertions(+), 11 deletions(-) create mode 100644 docs/CommitTree.md create mode 100644 docs/SingleCommit.md create mode 100644 gitee/model_commit_tree.go create mode 100644 gitee/model_single_commit.go diff --git a/README.md b/README.md index 7ce0f62..b0a646a 100644 --- a/README.md +++ b/README.md @@ -264,6 +264,7 @@ Class | Method | HTTP request | Description - [CodeForksHistory](docs/CodeForksHistory.md) - [Commit](docs/Commit.md) - [CommitContent](docs/CommitContent.md) + - [CommitTree](docs/CommitTree.md) - [Compare](docs/Compare.md) - [CompleteBranch](docs/CompleteBranch.md) - [Content](docs/Content.md) @@ -309,6 +310,7 @@ Class | Method | HTTP request | Description - [RepoCommit](docs/RepoCommit.md) - [RepoPatchParam](docs/RepoPatchParam.md) - [RepositoryPostParam](docs/RepositoryPostParam.md) + - [SingleCommit](docs/SingleCommit.md) - [SshKey](docs/SshKey.md) - [SshKeyBasic](docs/SshKeyBasic.md) - [Tag](docs/Tag.md) diff --git a/api/swagger.yaml b/api/swagger.yaml index 57b6f61..4f219ea 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -13293,7 +13293,7 @@ definitions: comments_url: type: "string" commit: - type: "string" + $ref: "#/definitions/SingleCommit" author: type: "string" committer: @@ -13313,6 +13313,18 @@ definitions: sha: "sha" url: "url" parents: "parents" + SingleCommit: + type: "object" + properties: + tree: + $ref: "#/definitions/CommitTree" + CommitTree: + type: "object" + properties: + sha: + type: "string" + url: + type: "string" Compare: type: "object" properties: diff --git a/docs/CommitTree.md b/docs/CommitTree.md new file mode 100644 index 0000000..f968bb8 --- /dev/null +++ b/docs/CommitTree.md @@ -0,0 +1,11 @@ +# CommitTree + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Sha** | **string** | | [optional] [default to null] +**Url** | **string** | | [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/RepoCommit.md b/docs/RepoCommit.md index 7bb78c9..9a2a091 100644 --- a/docs/RepoCommit.md +++ b/docs/RepoCommit.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **Sha** | **string** | | [optional] [default to null] **HtmlUrl** | **string** | | [optional] [default to null] **CommentsUrl** | **string** | | [optional] [default to null] -**Commit** | **string** | | [optional] [default to null] +**Commit** | [***SingleCommit**](SingleCommit.md) | | [optional] [default to null] **Author** | **string** | | [optional] [default to null] **Committer** | **string** | | [optional] [default to null] **Parents** | **string** | | [optional] [default to null] diff --git a/docs/SingleCommit.md b/docs/SingleCommit.md new file mode 100644 index 0000000..749d4e6 --- /dev/null +++ b/docs/SingleCommit.md @@ -0,0 +1,10 @@ +# SingleCommit + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Tree** | [***CommitTree**](CommitTree.md) | | [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_commit_tree.go b/gitee/model_commit_tree.go new file mode 100644 index 0000000..70c0f39 --- /dev/null +++ b/gitee/model_commit_tree.go @@ -0,0 +1,15 @@ +/* + * 码云 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 CommitTree struct { + Sha string `json:"sha,omitempty"` + Url string `json:"url,omitempty"` +} diff --git a/gitee/model_repo_commit.go b/gitee/model_repo_commit.go index c0969ea..3913a6f 100644 --- a/gitee/model_repo_commit.go +++ b/gitee/model_repo_commit.go @@ -11,13 +11,13 @@ package gitee // 仓库的某个提交 type RepoCommit struct { - Url string `json:"url,omitempty"` - Sha string `json:"sha,omitempty"` - HtmlUrl string `json:"html_url,omitempty"` - CommentsUrl string `json:"comments_url,omitempty"` - Commit string `json:"commit,omitempty"` - Author string `json:"author,omitempty"` - Committer string `json:"committer,omitempty"` - Parents string `json:"parents,omitempty"` - Stats string `json:"stats,omitempty"` + Url string `json:"url,omitempty"` + Sha string `json:"sha,omitempty"` + HtmlUrl string `json:"html_url,omitempty"` + CommentsUrl string `json:"comments_url,omitempty"` + Commit *SingleCommit `json:"commit,omitempty"` + Author string `json:"author,omitempty"` + Committer string `json:"committer,omitempty"` + Parents string `json:"parents,omitempty"` + Stats string `json:"stats,omitempty"` } diff --git a/gitee/model_single_commit.go b/gitee/model_single_commit.go new file mode 100644 index 0000000..edc8d6d --- /dev/null +++ b/gitee/model_single_commit.go @@ -0,0 +1,14 @@ +/* + * 码云 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 SingleCommit struct { + Tree *CommitTree `json:"tree,omitempty"` +} -- GitLab