aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/feed
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2024-11-29 09:53:49 -0800
committerGitHub <noreply@github.com>2024-11-29 17:53:49 +0000
commit1ed5f379b9f3e38b64cc9de9f418c164ce400be1 (patch)
treedee6e19dd5c3ae6e96df2c926f199bb3c1c1299b /routers/web/feed
parent93640993e3cca9d0e0261591ba38b84b0b99ab12 (diff)
downloadgitea-1ed5f379b9f3e38b64cc9de9f418c164ce400be1.tar.gz
gitea-1ed5f379b9f3e38b64cc9de9f418c164ce400be1.zip
Move GetFeeds to service layer (#32526)
Move GetFeeds from models to service layer, no code change.
Diffstat (limited to 'routers/web/feed')
-rw-r--r--routers/web/feed/profile.go3
-rw-r--r--routers/web/feed/repo.go3
2 files changed, 4 insertions, 2 deletions
diff --git a/routers/web/feed/profile.go b/routers/web/feed/profile.go
index 47de7c089d..4ec46e302a 100644
--- a/routers/web/feed/profile.go
+++ b/routers/web/feed/profile.go
@@ -10,6 +10,7 @@ import (
"code.gitea.io/gitea/models/renderhelper"
"code.gitea.io/gitea/modules/markup/markdown"
"code.gitea.io/gitea/services/context"
+ feed_service "code.gitea.io/gitea/services/feed"
"github.com/gorilla/feeds"
)
@@ -28,7 +29,7 @@ func ShowUserFeedAtom(ctx *context.Context) {
func showUserFeed(ctx *context.Context, formatType string) {
includePrivate := ctx.IsSigned && (ctx.Doer.IsAdmin || ctx.Doer.ID == ctx.ContextUser.ID)
- actions, _, err := activities_model.GetFeeds(ctx, activities_model.GetFeedsOptions{
+ actions, _, err := feed_service.GetFeeds(ctx, activities_model.GetFeedsOptions{
RequestedUser: ctx.ContextUser,
Actor: ctx.Doer,
IncludePrivate: includePrivate,
diff --git a/routers/web/feed/repo.go b/routers/web/feed/repo.go
index bfcc3a37d6..2e69fac758 100644
--- a/routers/web/feed/repo.go
+++ b/routers/web/feed/repo.go
@@ -9,13 +9,14 @@ import (
activities_model "code.gitea.io/gitea/models/activities"
repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/services/context"
+ feed_service "code.gitea.io/gitea/services/feed"
"github.com/gorilla/feeds"
)
// ShowRepoFeed shows user activity on the repo as RSS / Atom feed
func ShowRepoFeed(ctx *context.Context, repo *repo_model.Repository, formatType string) {
- actions, _, err := activities_model.GetFeeds(ctx, activities_model.GetFeedsOptions{
+ actions, _, err := feed_service.GetFeeds(ctx, activities_model.GetFeedsOptions{
RequestedRepo: repo,
Actor: ctx.Doer,
IncludePrivate: true,