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

Commit

Permalink
Preparation for Issue due dates (go-gitea/gitea#2533) (#103)
Browse files Browse the repository at this point in the history
* Added deadline for issue

* Added deadline for pull requests

* Added comment for swagger date format
  • Loading branch information
kolaente authored and lunny committed Apr 17, 2018
1 parent 790adaa commit 142acef
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 21 deletions.
18 changes: 12 additions & 6 deletions gitea/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ type Issue struct {
Updated time.Time `json:"updated_at"`
// swagger:strfmt date-time
Closed *time.Time `json:"closed_at"`
// swagger:strfmt date-time
Deadline *time.Time `json:"due_date"`

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

// EditIssueOption options for editing an issue
type EditIssueOption struct {
Title string `json:"title"`
Body *string `json:"body"`
Assignee *string `json:"assignee"`
Assignees []string `json:"assignees"`
Milestone *int64 `json:"milestone"`
State *string `json:"state"`
Title string `json:"title"`
Body *string `json:"body"`
Assignee *string `json:"assignee"`
Assignees []string `json:"assignees"`
Milestone *int64 `json:"milestone"`
State *string `json:"state"`
// swagger:strfmt date-time
Deadline *time.Time `json:"due_date"`
}

// EditIssue modify an existing issue for a given repository
Expand Down
37 changes: 22 additions & 15 deletions gitea/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ type PullRequest struct {
Head *PRBranchInfo `json:"head"`
MergeBase string `json:"merge_base"`

// swagger:strfmt date-time
Deadline *time.Time `json:"due_date"`

// swagger:strfmt date-time
Created *time.Time `json:"created_at"`
// swagger:strfmt date-time
Expand Down Expand Up @@ -82,14 +85,16 @@ func (c *Client) GetPullRequest(owner, repo string, index int64) (*PullRequest,

// CreatePullRequestOption options when creating a pull request
type CreatePullRequestOption struct {
Head string `json:"head" binding:"Required"`
Base string `json:"base" binding:"Required"`
Title string `json:"title" binding:"Required"`
Body string `json:"body"`
Assignee string `json:"assignee"`
Assignees []string `json:"assignees"`
Milestone int64 `json:"milestone"`
Labels []int64 `json:"labels"`
Head string `json:"head" binding:"Required"`
Base string `json:"base" binding:"Required"`
Title string `json:"title" binding:"Required"`
Body string `json:"body"`
Assignee string `json:"assignee"`
Assignees []string `json:"assignees"`
Milestone int64 `json:"milestone"`
Labels []int64 `json:"labels"`
// swagger:strfmt date-time
Deadline *time.Time `json:"due_date"`
}

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

// EditPullRequestOption options when modify pull request
type EditPullRequestOption struct {
Title string `json:"title"`
Body string `json:"body"`
Assignee string `json:"assignee"`
Assignees []string `json:"assignees"`
Milestone int64 `json:"milestone"`
Labels []int64 `json:"labels"`
State *string `json:"state"`
Title string `json:"title"`
Body string `json:"body"`
Assignee string `json:"assignee"`
Assignees []string `json:"assignees"`
Milestone int64 `json:"milestone"`
Labels []int64 `json:"labels"`
State *string `json:"state"`
// swagger:strfmt date-time
Deadline *time.Time `json:"due_date"`
}

// EditPullRequest modify pull request with PR id and options
Expand Down

0 comments on commit 142acef

Please sign in to comment.