diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2024-11-29 09:53:49 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-29 17:53:49 +0000 |
commit | 1ed5f379b9f3e38b64cc9de9f418c164ce400be1 (patch) | |
tree | dee6e19dd5c3ae6e96df2c926f199bb3c1c1299b /routers/web/user | |
parent | 93640993e3cca9d0e0261591ba38b84b0b99ab12 (diff) | |
download | gitea-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/user')
-rw-r--r-- | routers/web/user/home.go | 3 | ||||
-rw-r--r-- | routers/web/user/profile.go | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/routers/web/user/home.go b/routers/web/user/home.go index 6149ccb08d..0cf932ac03 100644 --- a/routers/web/user/home.go +++ b/routers/web/user/home.go @@ -33,6 +33,7 @@ import ( "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/routers/web/feed" "code.gitea.io/gitea/services/context" + feed_service "code.gitea.io/gitea/services/feed" issue_service "code.gitea.io/gitea/services/issue" pull_service "code.gitea.io/gitea/services/pull" @@ -113,7 +114,7 @@ func Dashboard(ctx *context.Context) { ctx.Data["HeatmapTotalContributions"] = activities_model.GetTotalContributionsInHeatmap(data) } - feeds, count, err := activities_model.GetFeeds(ctx, activities_model.GetFeedsOptions{ + feeds, count, err := feed_service.GetFeeds(ctx, activities_model.GetFeedsOptions{ RequestedUser: ctxUser, RequestedTeam: ctx.Org.Team, Actor: ctx.Doer, diff --git a/routers/web/user/profile.go b/routers/web/user/profile.go index 931af0a283..c41030a5e2 100644 --- a/routers/web/user/profile.go +++ b/routers/web/user/profile.go @@ -26,6 +26,7 @@ import ( "code.gitea.io/gitea/routers/web/org" shared_user "code.gitea.io/gitea/routers/web/shared/user" "code.gitea.io/gitea/services/context" + feed_service "code.gitea.io/gitea/services/feed" ) const ( @@ -167,7 +168,7 @@ func prepareUserProfileTabData(ctx *context.Context, showPrivate bool, profileDb case "activity": date := ctx.FormString("date") pagingNum = setting.UI.FeedPagingNum - items, count, err := activities_model.GetFeeds(ctx, activities_model.GetFeedsOptions{ + items, count, err := feed_service.GetFeeds(ctx, activities_model.GetFeedsOptions{ RequestedUser: ctx.ContextUser, Actor: ctx.Doer, IncludePrivate: showPrivate, |