mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Use api.TrackedTime in API (#2807)
* Use api.TrackedTime in API * APIFormat() method * Rename function
This commit is contained in:
@@ -7,6 +7,8 @@ package models
|
||||
import (
|
||||
"time"
|
||||
|
||||
api "code.gitea.io/sdk/gitea"
|
||||
|
||||
"github.com/go-xorm/builder"
|
||||
)
|
||||
|
||||
@@ -25,6 +27,17 @@ func (t *TrackedTime) AfterLoad() {
|
||||
t.Created = time.Unix(t.CreatedUnix, 0).Local()
|
||||
}
|
||||
|
||||
// APIFormat converts TrackedTime to API format
|
||||
func (t *TrackedTime) APIFormat() *api.TrackedTime {
|
||||
return &api.TrackedTime{
|
||||
ID: t.ID,
|
||||
IssueID: t.IssueID,
|
||||
UserID: t.UserID,
|
||||
Time: t.Time,
|
||||
Created: t.Created,
|
||||
}
|
||||
}
|
||||
|
||||
// FindTrackedTimesOptions represent the filters for tracked times. If an ID is 0 it will be ignored.
|
||||
type FindTrackedTimesOptions struct {
|
||||
IssueID int64
|
||||
|
Reference in New Issue
Block a user