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/api/v1 | |
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/api/v1')
-rw-r--r-- | routers/api/v1/org/org.go | 3 | ||||
-rw-r--r-- | routers/api/v1/org/team.go | 3 | ||||
-rw-r--r-- | routers/api/v1/repo/repo.go | 3 | ||||
-rw-r--r-- | routers/api/v1/user/user.go | 3 |
4 files changed, 8 insertions, 4 deletions
diff --git a/routers/api/v1/org/org.go b/routers/api/v1/org/org.go index 9e58746272..3fb653bcb6 100644 --- a/routers/api/v1/org/org.go +++ b/routers/api/v1/org/org.go @@ -19,6 +19,7 @@ import ( "code.gitea.io/gitea/routers/api/v1/utils" "code.gitea.io/gitea/services/context" "code.gitea.io/gitea/services/convert" + feed_service "code.gitea.io/gitea/services/feed" "code.gitea.io/gitea/services/org" user_service "code.gitea.io/gitea/services/user" ) @@ -447,7 +448,7 @@ func ListOrgActivityFeeds(ctx *context.APIContext) { ListOptions: listOptions, } - feeds, count, err := activities_model.GetFeeds(ctx, opts) + feeds, count, err := feed_service.GetFeeds(ctx, opts) if err != nil { ctx.Error(http.StatusInternalServerError, "GetFeeds", err) return diff --git a/routers/api/v1/org/team.go b/routers/api/v1/org/team.go index 20226b4d6b..bc50960b61 100644 --- a/routers/api/v1/org/team.go +++ b/routers/api/v1/org/team.go @@ -22,6 +22,7 @@ import ( "code.gitea.io/gitea/routers/api/v1/utils" "code.gitea.io/gitea/services/context" "code.gitea.io/gitea/services/convert" + feed_service "code.gitea.io/gitea/services/feed" org_service "code.gitea.io/gitea/services/org" repo_service "code.gitea.io/gitea/services/repository" ) @@ -882,7 +883,7 @@ func ListTeamActivityFeeds(ctx *context.APIContext) { ListOptions: listOptions, } - feeds, count, err := activities_model.GetFeeds(ctx, opts) + feeds, count, err := feed_service.GetFeeds(ctx, opts) if err != nil { ctx.Error(http.StatusInternalServerError, "GetFeeds", err) return diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go index 69a95dd5a5..40990a28cb 100644 --- a/routers/api/v1/repo/repo.go +++ b/routers/api/v1/repo/repo.go @@ -34,6 +34,7 @@ import ( actions_service "code.gitea.io/gitea/services/actions" "code.gitea.io/gitea/services/context" "code.gitea.io/gitea/services/convert" + feed_service "code.gitea.io/gitea/services/feed" "code.gitea.io/gitea/services/issue" repo_service "code.gitea.io/gitea/services/repository" ) @@ -1313,7 +1314,7 @@ func ListRepoActivityFeeds(ctx *context.APIContext) { ListOptions: listOptions, } - feeds, count, err := activities_model.GetFeeds(ctx, opts) + feeds, count, err := feed_service.GetFeeds(ctx, opts) if err != nil { ctx.Error(http.StatusInternalServerError, "GetFeeds", err) return diff --git a/routers/api/v1/user/user.go b/routers/api/v1/user/user.go index a9011427fb..e668326861 100644 --- a/routers/api/v1/user/user.go +++ b/routers/api/v1/user/user.go @@ -13,6 +13,7 @@ import ( "code.gitea.io/gitea/routers/api/v1/utils" "code.gitea.io/gitea/services/context" "code.gitea.io/gitea/services/convert" + feed_service "code.gitea.io/gitea/services/feed" ) // Search search users @@ -214,7 +215,7 @@ func ListUserActivityFeeds(ctx *context.APIContext) { ListOptions: listOptions, } - feeds, count, err := activities_model.GetFeeds(ctx, opts) + feeds, count, err := feed_service.GetFeeds(ctx, opts) if err != nil { ctx.Error(http.StatusInternalServerError, "GetFeeds", err) return |