summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-01-11 10:59:41 +0800
committertechknowlogick <techknowlogick@gitea.io>2020-01-10 21:59:41 -0500
commit4d06d10dbafe7cfd404889b636d8e243058ee96f (patch)
treee8107acad719b45f2732b0736d4657cac65fb679 /models
parent705b1e49a8b2ac8df377120f70f3548df15cdf49 (diff)
downloadgitea-4d06d10dbafe7cfd404889b636d8e243058ee96f.tar.gz
gitea-4d06d10dbafe7cfd404889b636d8e243058ee96f.zip
Move tracked time api convert to convert package (#9665)
Diffstat (limited to 'models')
-rw-r--r--models/issue_tracked_time.go29
1 files changed, 0 insertions, 29 deletions
diff --git a/models/issue_tracked_time.go b/models/issue_tracked_time.go
index b84adbc59a..55e8baacd7 100644
--- a/models/issue_tracked_time.go
+++ b/models/issue_tracked_time.go
@@ -8,7 +8,6 @@ import (
"time"
"code.gitea.io/gitea/modules/setting"
- api "code.gitea.io/gitea/modules/structs"
"xorm.io/builder"
"xorm.io/xorm"
@@ -60,25 +59,6 @@ func (t *TrackedTime) loadAttributes(e Engine) (err error) {
return
}
-// APIFormat converts TrackedTime to API format
-func (t *TrackedTime) APIFormat() (apiT *api.TrackedTime) {
- apiT = &api.TrackedTime{
- ID: t.ID,
- IssueID: t.IssueID,
- UserID: t.UserID,
- UserName: t.User.Name,
- Time: t.Time,
- Created: t.Created,
- }
- if t.Issue != nil {
- apiT.Issue = t.Issue.APIFormat()
- }
- if t.User != nil {
- apiT.UserName = t.User.Name
- }
- return
-}
-
// LoadAttributes load Issue, User
func (tl TrackedTimeList) LoadAttributes() (err error) {
for _, t := range tl {
@@ -89,15 +69,6 @@ func (tl TrackedTimeList) LoadAttributes() (err error) {
return
}
-// APIFormat converts TrackedTimeList to API format
-func (tl TrackedTimeList) APIFormat() api.TrackedTimeList {
- result := make([]*api.TrackedTime, 0, len(tl))
- for _, t := range tl {
- result = append(result, t.APIFormat())
- }
- return result
-}
-
// FindTrackedTimesOptions represent the filters for tracked times. If an ID is 0 it will be ignored.
type FindTrackedTimesOptions struct {
IssueID int64