From 85dd5958c784973a8ee857c94c45043fca011c83 Mon Sep 17 00:00:00 2001 From: xiangxinyong Date: Mon, 4 Nov 2019 10:25:50 +0800 Subject: [PATCH] modify commit type --- api/swagger.yaml | 40 +++++++++++++++++++++++++++------------- docs/Commit.md | 16 +++++++++++----- gitee/model_commit.go | 22 ++++++++++++++++------ 3 files changed, 54 insertions(+), 24 deletions(-) diff --git a/api/swagger.yaml b/api/swagger.yaml index fe96fd6..2f0279d 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -13444,25 +13444,39 @@ definitions: Commit: type: "object" properties: - sha: - type: "string" - author: + id: type: "string" - committer: + tree_id: type: "string" + parent_ids: + type: "array" + items: + type: "string" message: type: "string" - tree: + timestamp: type: "string" - parents: + format: "date-time" + url: type: "string" - example: - committer: "committer" - author: "author" - tree: "tree" - message: "message" - sha: "sha" - parents: "parents" + author: + $ref: "#/definitions/UserBasic" + committer: + $ref: "#/definitions/UserBasic" + distinct: + type: "boolean" + added: + type: "array" + items: + type: "string" + removed: + type: "array" + items: + type: "string" + modified: + type: "array" + items: + type: "string" Blob: type: "object" properties: diff --git a/docs/Commit.md b/docs/Commit.md index 62f24a6..3f690e6 100644 --- a/docs/Commit.md +++ b/docs/Commit.md @@ -3,12 +3,18 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Sha** | **string** | | [optional] [default to null] -**Author** | **string** | | [optional] [default to null] -**Committer** | **string** | | [optional] [default to null] +**Id** | **string** | | [optional] [default to null] +**TreeId** | **string** | | [optional] [default to null] +**ParentIds** | **[]string** | | [optional] [default to null] **Message** | **string** | | [optional] [default to null] -**Tree** | **string** | | [optional] [default to null] -**Parents** | **string** | | [optional] [default to null] +**Timestamp** | [**time.Time**](time.Time.md) | | [optional] [default to null] +**Url** | **string** | | [optional] [default to null] +**Author** | [***UserBasic**](UserBasic.md) | | [optional] [default to null] +**Committer** | [***UserBasic**](UserBasic.md) | | [optional] [default to null] +**Distinct** | **bool** | | [optional] [default to null] +**Added** | **[]string** | | [optional] [default to null] +**Removed** | **[]string** | | [optional] [default to null] +**Modified** | **[]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/gitee/model_commit.go b/gitee/model_commit.go index d793e52..a03ec91 100644 --- a/gitee/model_commit.go +++ b/gitee/model_commit.go @@ -9,11 +9,21 @@ package gitee +import ( + "time" +) + type Commit struct { - Sha string `json:"sha,omitempty"` - Author string `json:"author,omitempty"` - Committer string `json:"committer,omitempty"` - Message string `json:"message,omitempty"` - Tree string `json:"tree,omitempty"` - Parents string `json:"parents,omitempty"` + Id string `json:"id,omitempty"` + TreeId string `json:"tree_id,omitempty"` + ParentIds []string `json:"parent_ids,omitempty"` + Message string `json:"message,omitempty"` + Timestamp time.Time `json:"timestamp,omitempty"` + Url string `json:"url,omitempty"` + Author *UserBasic `json:"author,omitempty"` + Committer *UserBasic `json:"committer,omitempty"` + Distinct bool `json:"distinct,omitempty"` + Added []string `json:"added,omitempty"` + Removed []string `json:"removed,omitempty"` + Modified []string `json:"modified,omitempty"` } -- GitLab