Skip to content
This repository was archived by the owner on Jun 8, 2019. It is now read-only.

Commit 142acef

Browse files
kolaentelunny
authored andcommitted
Preparation for Issue due dates (go-gitea/gitea#2533) (#103)
* Added deadline for issue * Added deadline for pull requests * Added comment for swagger date format
1 parent 790adaa commit 142acef

File tree

2 files changed

+34
-21
lines changed

2 files changed

+34
-21
lines changed

gitea/issue.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ type Issue struct {
5252
Updated time.Time `json:"updated_at"`
5353
// swagger:strfmt date-time
5454
Closed *time.Time `json:"closed_at"`
55+
// swagger:strfmt date-time
56+
Deadline *time.Time `json:"due_date"`
5557

5658
PullRequest *PullRequestMeta `json:"pull_request"`
5759
}
@@ -94,6 +96,8 @@ type CreateIssueOption struct {
9496
// username of assignee
9597
Assignee string `json:"assignee"`
9698
Assignees []string `json:"assignees"`
99+
// swagger:strfmt date-time
100+
Deadline *time.Time `json:"due_date"`
97101
// milestone id
98102
Milestone int64 `json:"milestone"`
99103
// list of label ids
@@ -114,12 +118,14 @@ func (c *Client) CreateIssue(owner, repo string, opt CreateIssueOption) (*Issue,
114118

115119
// EditIssueOption options for editing an issue
116120
type EditIssueOption struct {
117-
Title string `json:"title"`
118-
Body *string `json:"body"`
119-
Assignee *string `json:"assignee"`
120-
Assignees []string `json:"assignees"`
121-
Milestone *int64 `json:"milestone"`
122-
State *string `json:"state"`
121+
Title string `json:"title"`
122+
Body *string `json:"body"`
123+
Assignee *string `json:"assignee"`
124+
Assignees []string `json:"assignees"`
125+
Milestone *int64 `json:"milestone"`
126+
State *string `json:"state"`
127+
// swagger:strfmt date-time
128+
Deadline *time.Time `json:"due_date"`
123129
}
124130

125131
// EditIssue modify an existing issue for a given repository

gitea/pull.go

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ type PullRequest struct {
4141
Head *PRBranchInfo `json:"head"`
4242
MergeBase string `json:"merge_base"`
4343

44+
// swagger:strfmt date-time
45+
Deadline *time.Time `json:"due_date"`
46+
4447
// swagger:strfmt date-time
4548
Created *time.Time `json:"created_at"`
4649
// swagger:strfmt date-time
@@ -82,14 +85,16 @@ func (c *Client) GetPullRequest(owner, repo string, index int64) (*PullRequest,
8285

8386
// CreatePullRequestOption options when creating a pull request
8487
type CreatePullRequestOption struct {
85-
Head string `json:"head" binding:"Required"`
86-
Base string `json:"base" binding:"Required"`
87-
Title string `json:"title" binding:"Required"`
88-
Body string `json:"body"`
89-
Assignee string `json:"assignee"`
90-
Assignees []string `json:"assignees"`
91-
Milestone int64 `json:"milestone"`
92-
Labels []int64 `json:"labels"`
88+
Head string `json:"head" binding:"Required"`
89+
Base string `json:"base" binding:"Required"`
90+
Title string `json:"title" binding:"Required"`
91+
Body string `json:"body"`
92+
Assignee string `json:"assignee"`
93+
Assignees []string `json:"assignees"`
94+
Milestone int64 `json:"milestone"`
95+
Labels []int64 `json:"labels"`
96+
// swagger:strfmt date-time
97+
Deadline *time.Time `json:"due_date"`
9398
}
9499

95100
// CreatePullRequest create pull request with options
@@ -105,13 +110,15 @@ func (c *Client) CreatePullRequest(owner, repo string, opt CreatePullRequestOpti
105110

106111
// EditPullRequestOption options when modify pull request
107112
type EditPullRequestOption struct {
108-
Title string `json:"title"`
109-
Body string `json:"body"`
110-
Assignee string `json:"assignee"`
111-
Assignees []string `json:"assignees"`
112-
Milestone int64 `json:"milestone"`
113-
Labels []int64 `json:"labels"`
114-
State *string `json:"state"`
113+
Title string `json:"title"`
114+
Body string `json:"body"`
115+
Assignee string `json:"assignee"`
116+
Assignees []string `json:"assignees"`
117+
Milestone int64 `json:"milestone"`
118+
Labels []int64 `json:"labels"`
119+
State *string `json:"state"`
120+
// swagger:strfmt date-time
121+
Deadline *time.Time `json:"due_date"`
115122
}
116123

117124
// EditPullRequest modify pull request with PR id and options

0 commit comments

Comments
 (0)