From 488204ae3128ad6ed92629b593fce0b7ae53ba96 Mon Sep 17 00:00:00 2001 From: Norwin Date: Tue, 31 Dec 2019 04:01:26 +0000 Subject: [PATCH] update TrackedTimes structs (#196) (#198) update TrackedTimes structs for changes in https://github.com/go-gitea/gitea/pull/9200 Co-authored-by: Norwin Roosen Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: Andrew Thornton --- gitea/issue_tracked_time.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/gitea/issue_tracked_time.go b/gitea/issue_tracked_time.go index faec0a0..0ab00fc 100644 --- a/gitea/issue_tracked_time.go +++ b/gitea/issue_tracked_time.go @@ -16,9 +16,13 @@ type TrackedTime struct { ID int64 `json:"id"` Created time.Time `json:"created"` // Time in seconds - Time int64 `json:"time"` - UserID int64 `json:"user_id"` - IssueID int64 `json:"issue_id"` + Time int64 `json:"time"` + // deprecated (only for backwards compatibility) + UserID int64 `json:"user_id"` + UserName string `json:"user_name"` + // deprecated (only for backwards compatibility) + IssueID int64 `json:"issue_id"` + Issue *Issue `json:"issue"` } // GetUserTrackedTimes list tracked times of a user @@ -42,7 +46,11 @@ func (c *Client) GetMyTrackedTimes() ([]*TrackedTime, error) { // AddTimeOption options for adding time to an issue type AddTimeOption struct { // time in seconds - Time int64 `json:"time"` + Time int64 `json:"time" binding:"Required"` + // optional + Created time.Time `json:"created"` + // optional + User string `json:"user_name"` } // AddTime adds time to issue with the given index