Skip to content

Commit 092f9c4

Browse files
committed
fix import cycle
1 parent f994514 commit 092f9c4

File tree

4 files changed

+22
-17
lines changed

4 files changed

+22
-17
lines changed

routers/api/v1/repo/wiki.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ func getUncycloPage(ctx *context.APIContext, wikiName wiki_service.WebPath) *api.Wi
202202
}
203203

204204
return &api.UncycloPage{
205-
UncycloPageMetaData: convert.ToUncycloPageMetaData(wikiName, lastCommit, ctx.Repo.Repository),
205+
UncycloPageMetaData: wiki_service.ToUncycloPageMetaData(wikiName, lastCommit, ctx.Repo.Repository),
206206
ContentBase64: content,
207207
CommitCount: commitsCount,
208208
Sidebar: sidebarContent,
@@ -332,7 +332,7 @@ func ListUncycloPages(ctx *context.APIContext) {
332332
ctx.Error(http.StatusInternalServerError, "UncycloFilenameToName", err)
333333
return
334334
}
335-
pages = append(pages, convert.ToUncycloPageMetaData(wikiName, c, ctx.Repo.Repository))
335+
pages = append(pages, wiki_service.ToUncycloPageMetaData(wikiName, c, ctx.Repo.Repository))
336336
}
337337

338338
ctx.SetTotalCountHeader(int64(len(entries)))

services/actions/notifier_helper.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,3 +473,8 @@ func handleSchedules(
473473

474474
return actions_model.CreateScheduleTask(ctx, crons)
475475
}
476+
477+
func DetactAndHandleSchedules(ctx context.Context, repo *repo_model.Repository) error {
478+
// TODO
479+
return nil
480+
}

services/convert/wiki.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@ package convert
66
import (
77
"time"
88

9-
repo_model "code.gitea.io/gitea/models/repo"
109
"code.gitea.io/gitea/modules/git"
1110
api "code.gitea.io/gitea/modules/structs"
12-
"code.gitea.io/gitea/modules/util"
13-
wiki_service "code.gitea.io/gitea/services/wiki"
1411
)
1512

1613
// ToUncycloCommit convert a git commit into a UncycloCommit
@@ -46,15 +43,3 @@ func ToUncycloCommitList(commits []*git.Commit, total int64) *api.UncycloCommitList {
4643
Count: total,
4744
}
4845
}
49-
50-
// ToUncycloPageMetaData converts meta information to a UncycloPageMetaData
51-
func ToUncycloPageMetaData(wikiName wiki_service.WebPath, lastCommit *git.Commit, repo *repo_model.Repository) *api.UncycloPageMetaData {
52-
subURL := string(wikiName)
53-
_, title := wiki_service.WebPathToUserTitle(wikiName)
54-
return &api.UncycloPageMetaData{
55-
Title: title,
56-
HTMLURL: util.URLJoin(repo.HTMLURL(), "wiki", subURL),
57-
SubURL: subURL,
58-
LastCommit: ToUncycloCommit(lastCommit),
59-
}
60-
}

services/wiki/wiki_path.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import (
99
"strings"
1010

1111
repo_model "code.gitea.io/gitea/models/repo"
12+
"code.gitea.io/gitea/modules/git"
13+
api "code.gitea.io/gitea/modules/structs"
1214
"code.gitea.io/gitea/modules/util"
15+
"code.gitea.io/gitea/services/convert"
1316
)
1417

1518
// To define the wiki related concepts:
@@ -155,3 +158,15 @@ func UserTitleToWebPath(base, title string) WebPath {
155158
}
156159
return WebPath(title)
157160
}
161+
162+
// ToUncycloPageMetaData converts meta information to a UncycloPageMetaData
163+
func ToUncycloPageMetaData(wikiName WebPath, lastCommit *git.Commit, repo *repo_model.Repository) *api.UncycloPageMetaData {
164+
subURL := string(wikiName)
165+
_, title := WebPathToUserTitle(wikiName)
166+
return &api.UncycloPageMetaData{
167+
Title: title,
168+
HTMLURL: util.URLJoin(repo.HTMLURL(), "wiki", subURL),
169+
SubURL: subURL,
170+
LastCommit: convert.ToUncycloCommit(lastCommit),
171+
}
172+
}

0 commit comments

Comments
 (0)